Skip to content

你好,请问go1.17运行代码,怎么解决go mod或GOPATH出现的找不到包的问题 #6

Description

@Terrygmx

我试着run或build第一章的main.go,如果使用了go mod就会出现以下错误:

main.go:4:2: local import "./cache" in non-local package
main.go:5:2: local import "./http" in non-local package

删除go mod,会出现:
to create a module there, run:
cd ../.. && go mod init

这里我使用了 go mod init 或 export GOPATH=pwd 等都不能正常编译成功。请教在1.17版本如何运行代码

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions