1. 03 Mar, 2012 3 commits
    • Russ Cox's avatar
      cmd/go: fix relative imports again · 604f3751
      Russ Cox authored
      I tried before to make relative imports work by simply
      invoking the compiler in the right directory, so that
      an import of ./foo could be resolved by ./foo.a.
      This required creating a separate tree of package binaries
      that included the full path to the source directory, so that
      /home/gopher/bar.go would be compiled in
      tmpdir/work/local/home/gopher and perhaps find
      a ./foo.a in that directory.
      
      This model breaks on Windows because : appears in path
      names but cannot be used in subdirectory names, and I
      missed one or two places where it needed to be removed.
      
      The model breaks more fundamentally when compiling
      a test of a package that lives outside the Go path, because
      we effectively use a ./ import in the generated testmain,
      but there we want to be able to resolve the ./ import
      of the test package to one directory and all the other ./
      imports to a different directory.  Piggybacking on the compiler's
      current working directory is then no longer possible.
      
      Instead, introduce a new compiler option -D prefix that
      makes the compiler turn a ./ import into prefix+that,
      so that import "./foo" with -D a/b/c turns into import
      "a/b/c/foo".  Then we can invent a package hierarchy
      "_/" with subdirectories named for file system paths:
      import "./foo" in the directory /home/gopher becomes
      import "_/home/gopher/foo", and since that final path
      is just an ordinary import now, all the ordinary processing
      works, without special cases.
      
      We will have to change the name of the hierarchy if we
      ever decide to introduce a standard package with import
      path "_", but that seems unlikely, and the detail is known
      only in temporary packages that get thrown away at the
      end of a build.
      
      Fixes #3169.
      
      R=golang-dev, r
      CC=golang-dev
      https://golang.org/cl/5732045
      604f3751
    • Andrew Gerrand's avatar
      doc: remove roadmap document · 120c2238
      Andrew Gerrand authored
      R=golang-dev, bradfitz
      CC=golang-dev
      https://golang.org/cl/5726047
      120c2238
    • Andrew Gerrand's avatar
      doc: change wording on references page · aabf2ee8
      Andrew Gerrand authored
      R=golang-dev
      CC=golang-dev
      https://golang.org/cl/5728050
      aabf2ee8
  2. 02 Mar, 2012 21 commits
  3. 01 Mar, 2012 16 commits
    • Russ Cox's avatar
      go/build: document GOPATH · 93160704
      Russ Cox authored
      Fixes #2332.
      
      R=golang-dev, remyoudompheng, gri, r, r
      CC=golang-dev
      https://golang.org/cl/5710055
      93160704
    • Russ Cox's avatar
      doc: describe API changes to go/build · 9996f7f1
      Russ Cox authored
      R=golang-dev, gri, r
      CC=golang-dev
      https://golang.org/cl/5711059
      9996f7f1
    • Gustavo Niemeyer's avatar
      cmd/go: fix verbose command displaying · e8c970e5
      Gustavo Niemeyer authored
      R=golang-dev, rsc
      CC=golang-dev
      https://golang.org/cl/5715050
      e8c970e5
    • Gustavo Niemeyer's avatar
      cmd/go: fix -I flag for gc command · 04450d8a
      Gustavo Niemeyer authored
      R=rsc, remyoudompheng
      CC=golang-dev
      https://golang.org/cl/5711056
      04450d8a
    • Robert Griesemer's avatar
      all: fixed various typos · 7c6654aa
      Robert Griesemer authored
      (Semi-automatically detected.)
      
      R=golang-dev, remyoudompheng, r
      CC=golang-dev
      https://golang.org/cl/5715052
      7c6654aa
    • Russ Cox's avatar
      reflect: expand doc for Value.Interface · af954996
      Russ Cox authored
      R=golang-dev, r
      CC=golang-dev
      https://golang.org/cl/5716057
      af954996
    • Robert Griesemer's avatar
      spec: clarifications around exports, uniqueness of identifiers · 103c9db7
      Robert Griesemer authored
      - Define what it means for two identifiers to be unique.
      
      - The current spec is incorrect about exported
      identifiers: for instance, it excluded fields
      of non-exported types of exported variables
      from being exported. It is easier to leave
      the detailed specification away and let the
      rest of the spec govern access of exported
      identifiers.
      
      - The current spec is incorrect about qualified
      identifiers: It simply required that an identifier
      be exported to be valid in a qualified identifier.
      However, qualified identifiers can only access
      exported identifiers declared in the package
      block of the imported package.
      
      Fixes #1551.
      
      R=r, rsc, iant, ken
      CC=golang-dev
      https://golang.org/cl/5711043
      103c9db7
    • Russ Cox's avatar
      cmd/dist: Unix grammar fix · 3c3c5f38
      Russ Cox authored
      Fixes #3165.
      
      R=golang-dev, iant
      CC=golang-dev
      https://golang.org/cl/5712051
      3c3c5f38
    • Robert Griesemer's avatar
      spec: minor tweaks · 953f2dec
      Robert Griesemer authored
      - more idiomatic examples of pointer types
      - show use of _ in examples of function types
      - remove "legal:" qualification in examples
        for consistency
      
      R=golang-dev, rsc
      CC=golang-dev
      https://golang.org/cl/5711054
      953f2dec
    • Gustavo Niemeyer's avatar
      encoding/xml: fix xml test tag usage · b5d4cffd
      Gustavo Niemeyer authored
      No real problem.
      
      R=golang-dev, rsc
      CC=golang-dev
      https://golang.org/cl/5717049
      b5d4cffd
    • Dmitriy Vyukov's avatar
      sync: add Once example · 2295554d
      Dmitriy Vyukov authored
      R=golang-dev, rsc, bradfitz
      CC=golang-dev
      https://golang.org/cl/5715046
      2295554d
    • Dmitriy Vyukov's avatar
      sync: remove old WaitGroup example · 986df83e
      Dmitriy Vyukov authored
      The docs look awkward - there is a paragraph
      "For example:" with a plain text example,
      and straight below it a real Example.
      
      R=golang-dev, rsc
      CC=golang-dev
      https://golang.org/cl/5717048
      986df83e
    • Russ Cox's avatar
      cmd/go: fixes · b03a5f66
      Russ Cox authored
      * Install tools into tool dir always
        (Fixes issue 3049.  Fixes issue 2868.  Fixes issue 2925.)
      * Make packages depend on compiler, linker (Fixes issue 3036.)
      * Do not recompile packages across roots (Fixes issue 3149.)
      * Allow use of binary-only packages (Fixes issue 2775.)
      * Avoid duplicate cgo dependencies (Fixes issue 3001.)
      * Show less in go get -x.  (Fixes issue 2926.)
      * Do not force repo root for existing checkout (Fixes issue 2969.)
      * Show full syntax error list always (Fixes issue 2811.)
      * Clean arguments before processing (Fixes issue 3034.)
      * Add flags for compiler, linker arguments (Fixes issue 2996.)
      * Pass flags in make.bash (Fixes issue 3091.)
      * Unify build flags, defined in one place.
      * Clean up error messages (Fixes issue 3075.  Fixes issue 2923.)
      * Support local import paths (Fixes issue 3118.)
      * Allow top-level package outside $GOPATH (Fixes issue 3009.)
      
      In addition to these fixes, all commands now take a list of
      go files as a way to specify a single package, just as go build and
      go run always have.  This means you can:
      
              go list -json x.go
              go fix x.go
              go vet x.go
              go test x_test.go
      
      Preliminary tests in test.bash.
      Mainly testing things that the ordinary build does not.
      I don't mind if the script doesn't run on Windows.
      
      I expect that gccgo support is now broken, and I hope that
      people will feel free to file issues and/or send CLs to fix it.  :-)
      
      R=golang-dev, dsymonds, r, rogpeppe
      CC=golang-dev
      https://golang.org/cl/5708054
      b03a5f66
    • Russ Cox's avatar
      go/build: replace FindTree, ScanDir, Tree, DirInfo with Import, Package · ebe1664d
      Russ Cox authored
      This is an API change, but one I have been promising would
      happen when it was clear what the go command needed.
      
      This is basically a complete replacement of what used to be here.
      
      build.Tree is gone.
      
      build.DirInfo is expanded and now called build.Package.
      
      build.FindTree is now build.Import(package, srcDir, build.FindOnly).
      The returned *Package contains information that FindTree returned,
      but applicable only to a single package.
      
      build.ScanDir is now build.ImportDir.
      
      build.FindTree+build.ScanDir is now build.Import.
      
      The new Import API allows specifying the source directory,
      in order to resolve local imports (import "./foo") and also allows
      scanning of packages outside of $GOPATH.  They will come back
      with less information in the Package, but they will still work.
      
      The old go/build API exposed both too much and too little.
      This API is much closer to what the go command needs,
      and it works well enough in the other places where it is
      used.  Path is gone, so it can no longer be misused.  (Fixes issue 2749.)
      
      This CL updates clients of go/build other than the go command.
      The go command changes are in a separate CL, to be submitted
      at the same time.
      
      R=golang-dev, r, alex.brainman, adg
      CC=golang-dev
      https://golang.org/cl/5713043
      ebe1664d
    • Russ Cox's avatar
      reflect: make Value.Interface return immutable data · a72b87ef
      Russ Cox authored
      Fixes #3134.
      
      R=golang-dev, r
      CC=golang-dev
      https://golang.org/cl/5713049
      a72b87ef
    • Russ Cox's avatar
      runtime: run init on main thread · dc159fab
      Russ Cox authored
      Fixes #3125.
      
      R=golang-dev, r, minux.ma
      CC=golang-dev
      https://golang.org/cl/5714049
      dc159fab