does not match go tool version

mac下go版本匹配错误解决

之前pkg包安装好go使1.11版本,昨天鬼使神差的brew安装了1.12版本。然后今天开机运行报错

# errors
compile: version "go1.11.1" does not match go tool version "go1.12.6"
# internal/race
compile: version "go1.11.1" does not match go tool version "go1.12.6"
# internal/cpu
flag provided but not defined: -gensymabis
usage: asm [options] file.s ...
Flags:
  -D value
        predefined symbol with optional simple value -D=identifier=value; can be set multiple times
  -I value
        include directory; can be set multiple times
  -S    print assembly and machine code
  -V    print version and exit
  -debug
        dump instructions as they are parsed
  -dynlink
        support references to Go symbols defined in other shared libraries
  -e    no limit on number of errors reported
  -o string
        output file; default foo.o for /a/b/c/foo.s as first argument
  -shared
        generate code that can be linked into a shared library
  -trimpath string
        remove prefix from recorded source file paths
# runtime/internal/sys
compile: version "go1.11.1" does not match go tool version "go1.12.6"
# runtime/internal/atomic
flag provided but not defined: -gensymabis
usage: asm [options] file.s ...
Flags:
  -D value
        predefined symbol with optional simple value -D=identifier=value; can be set multiple times
  -I value
        include directory; can be set multiple times
  -S    print assembly and machine code
  -V    print version and exit
  -debug
        dump instructions as they are parsed
  -dynlink
        support references to Go symbols defined in other shared libraries
  -e    no limit on number of errors reported
  -o string
        output file; default foo.o for /a/b/c/foo.s as first argument
  -shared
        generate code that can be linked into a shared library
  -trimpath string
        remove prefix from recorded source file paths
# sync/atomic
flag provided but not defined: -gensymabis
usage: asm [options] file.s ...
Flags:
  -D value
        predefined symbol with optional simple value -D=identifier=value; can be set multiple times
  -I value
        include directory; can be set multiple times
  -S    print assembly and machine code
  -V    print version and exit
  -debug
        dump instructions as they are parsed
  -dynlink
        support references to Go symbols defined in other shared libraries
  -e    no limit on number of errors reported
  -o string
        output file; default foo.o for /a/b/c/foo.s as first argument
  -shared
        generate code that can be linked into a shared library
  -trimpath string
        remove prefix from recorded source file paths
# unicode
compile: version "go1.11.1" does not match go tool version "go1.12.6"
# unicode/utf8
compile: version "go1.11.1" does not match go tool version "go1.12.6"
# encoding
compile: version "go1.11.1" does not match go tool version "go1.12.6"
# math/bits
compile: version "go1.11.1" does not match go tool version "go1.12.6"
# unicode/utf16
compile: version "go1.11.1" does not match go tool version "go1.12.6"
# crypto/internal/subtle
compile: version "go1.11.1" does not match go tool version "go1.12.6"
# container/list
compile: version "go1.11.1" does not match go tool version "go1.12.6"
# crypto/subtle
compile: version "go1.11.1" does not match go tool version "go1.12.6"
# vendor/golang_org/x/crypto/cryptobyte/asn1
compile: version "go1.11.1" does not match go tool version "go1.12.6"
# internal/nettrace
compile: version "go1.11.1" does not match go tool version "go1.12.6"
# vendor/golang_org/x/crypto/curve25519
flag provided but not defined: -gensymabis
usage: asm [options] file.s ...
Flags:
  -D value
        predefined symbol with optional simple value -D=identifier=value; can be set multiple times
  -I value
        include directory; can be set multiple times
  -S    print assembly and machine code
  -V    print version and exit
  -debug
        dump instructions as they are parsed
  -dynlink
        support references to Go symbols defined in other shared libraries
  -e    no limit on number of errors reported
  -o string
        output file; default foo.o for /a/b/c/foo.s as first argument
  -shared
        generate code that can be linked into a shared library
  -trimpath string
        remove prefix from recorded source file paths
# image/color
compile: version "go1.11.1" does not match go tool version "go1.12.6"
# github.com/go-playground/locales/currency
compile: version "go1.11.1" does not match go tool version "go1.12.6"
# runtime/cgo
flag provided but not defined: -gensymabis
usage: asm [options] file.s ...
Flags:
  -D value
        predefined symbol with optional simple value -D=identifier=value; can be set multiple times
  -I value
        include directory; can be set multiple times
  -S    print assembly and machine code
  -V    print version and exit
  -debug
        dump instructions as they are parsed
  -dynlink
        support references to Go symbols defined in other shared libraries
  -e    no limit on number of errors reported
  -o string
        output file; default foo.o for /a/b/c/foo.s as first argument
  -shared
        generate code that can be linked into a shared library
  -trimpath string
        remove prefix from recorded source file paths

总体意思就是版本不匹配了,我的解决方法简单直接,卸载重装。
卸载pkg包安装的go,直接删除/usr/local/go目录。brew uninstall go卸载掉。
之后按照https://www.jianshu.com/p/e83415b530ec
进行安装

你可能感兴趣的:(does not match go tool version)