Skip to content

x/tools/go/packages: New version of go-tools doesn't support go1.10 #32575

Closed
@spellr

Description

@spellr

x/tools/go/packages is using -compiled flags when running go list, a flag that's not supported in go1.10

What version of Go are you using (go version)?

$ go version
go version go1.10 linux/amd64

Does this issue reproduce with the latest release?

no

What operating system and processor architecture are you using (go env)?

go env Output
$ go env
GOARCH="amd64"
GOBIN=""
GOCACHE="/tmp/.gocache"
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/go"
GORACE=""
GOROOT="/usr/local/go"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/linux_amd64"
GCCGO="gccgo"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build297327963=/tmp/go-build -gno-record-gcc-switches"

What did you do?

  1. Install go1.10
  2. go get -u golang.org/x/tools/...
  3. go run main.go
    main.go:
package main

import (
        "fmt"
        "golang.org/x/tools/go/packages"
)

func main() {
        var conf packages.Config
        _, err := packages.Load(&conf, "file=main.go")
        if err != nil {
                fmt.Println(err)
        }
}

What did you expect to see?

no output

What did you see instead?

bash-4.2$ go run main.go 
unsupported version of go: exit status 2: flag provided but not defined: -compiled
usage: list [-e] [-f format] [-json] [build flags] [packages]
Run 'go help list' for details.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions