Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Why I can't import fmt and local packages ????? #35648

Closed
ofzo opened this issue Nov 17, 2019 · 1 comment
Closed

Why I can't import fmt and local packages ????? #35648

ofzo opened this issue Nov 17, 2019 · 1 comment

Comments

@ofzo
Copy link

ofzo commented Nov 17, 2019

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

$ go version
go version go1.13.4 darwin/amd64

Does this issue reproduce with the latest release?

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

go env Output
$ go env

GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/Users/roadup/Library/Caches/go-build"
GOENV="/Users/roadup/Library/Application Support/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GONOPROXY=""
GONOSUMDB=""
GOOS="darwin"
GOPATH="/Users/roadup/.go"
GOPRIVATE=""
GOPROXY="https://goproxy.cn,direct"
GOROOT="/usr/local/Cellar/go/1.13.4/libexec"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/local/Cellar/go/1.13.4/libexec/pkg/tool/darwin_amd64"
GCCGO="gccgo"
AR="ar"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD="/Users/roadup/.go/src/github.com/onsunnny/paokemo/go.mod"
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 -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/c5/dvsgj0412q18f6v7sxzxpr700000gn/T/go-build461240957=/tmp/go-build -gno-record-gcc-switches -fno-common"

What did you do?

What did you expect to see?

Why go package manager is so hard to use?

Why I can't import some package by a relative path, if I rename my project , I need replace all of my imported packages in this project

What did you see instead?

image

@agnivade
Copy link
Contributor

Hi @onsunny - Go files under the same directory belong to the same package. So you don't need to "import" anything if you want to use things from db.go into main.go. I don't know why you cannot import "fmt' though.

In any case, unlike other projects, we do not use the issue tracker for questions such as these. It is only used for bugs and feature proposals. I will close this issue, but please feel free to ask it in any of these forums below:

Thanks

@golang golang locked and limited conversation to collaborators Nov 16, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants