7

我想使用 Go,Windows 上使用 MSYS2 的编程语言。
我应该使用哪个包以及如何避免以下错误:

package bufio: unrecognized import path "bufio"
package bytes: unrecognized import path "bytes"
package crypto: unrecognized import path "crypto"
package crypto/des: unrecognized import path "crypto/des"
package crypto/hmac: unrecognized import path "crypto/hmac"
package crypto/md5: unrecognized import path "crypto/md5"
package crypto/rand: unrecognized import path "crypto/rand"
package crypto/rc4: unrecognized import path "crypto/rc4"
package crypto/sha256: unrecognized import path "crypto/sha256"
package crypto/tls: unrecognized import path "crypto/tls"
package crypto/x509: unrecognized import path "crypto/x509"
package encoding/base64: unrecognized import path "encoding/base64"
package encoding/binary: unrecognized import path "encoding/binary"
package encoding/hex: unrecognized import path "encoding/hex"
package encoding/json: unrecognized import path "encoding/json"
package encoding/xml: unrecognized import path "encoding/xml"
package errors: unrecognized import path "errors"
package fmt: unrecognized import path "fmt"
package io: unrecognized import path "io"
package os: unrecognized import path "os"
package path/filepath: unrecognized import path "path/filepath"
package runtime: unrecognized import path "runtime"
package strconv: unrecognized import path "strconv"
package strings: unrecognized import path "strings"
package sync: unrecognized import path "sync"
package time: unrecognized import path "time"
package os/exec: unrecognized import path "os/exec"
package syscall: unrecognized import path "syscall"
package io/ioutil: unrecognized import path "io/ioutil"
package regexp: unrecognized import path "regexp"
package hash: unrecognized import path "hash"
package net: unrecognized import path "net"
package sync/atomic: unrecognized import path "sync/atomic"
package unsafe: unrecognized import path "unsafe"
package hash/crc32: unrecognized import path "hash/crc32"
package reflect: unrecognized import path "reflect"
package unicode/utf16: unrecognized import path "unicode/utf16"
package unicode: unrecognized import path "unicode"
package unicode/utf8: unrecognized import path "unicode/utf8"
package math: unrecognized import path "math"
package net/http: unrecognized import path "net/http"
package net/http/httputil: unrecognized import path "net/http/httputil"
package net/url: unrecognized import path "net/url"
package path: unrecognized import path "path"
package sort: unrecognized import path "sort"
package text/template: unrecognized import path "text/template"
package log: unrecognized import path "log"
package os/signal: unrecognized import path "os/signal"
4

1 回答 1

13

安装 Go 语言:pacman -S mingw-w64-x86_64-go

配置环境变量:

export GOROOT=/mingw64/lib/go
export GOPATH=/mingw64

开始使用 Go :)

go get将下载 (in mingw64/src)、编译并使二进制文件在您的路径 ( /mingw64/bin)上可用

于 2016-05-12T22:17:10.217 回答