Git Product home page Git Product logo

Comments (9)

duanjunxiao avatar duanjunxiao commented on May 19, 2024

你好,我也遇到一样的问题,请问解决了吗?

from studygolang.

NSObjects avatar NSObjects commented on May 19, 2024

@duanjunxiao 到代码里去删除/

from studygolang.

polaris1119 avatar polaris1119 commented on May 19, 2024

我这的代码没有多 / 呀,你代码是最新的吗?

from studygolang.

NSObjects avatar NSObjects commented on May 19, 2024

昨天拉下来的。go version go1.8.3 darwin/amd64 , macos 10.12.6, 代码里面import我都去手动改好才能运行 ,"http/middleware" ,需要我手动加studygolang/src/

from studygolang.

polaris1119 avatar polaris1119 commented on May 19, 2024

受到加这个是什么意思?还有这样的事情?

from studygolang.

NSObjects avatar NSObjects commented on May 19, 2024

我刚拉了份最新的源码,运行完getpkg.sh和install.sh后 在src/studygolang目录下运行main.go会报错。
go run main.go
main.go:10:2: cannot find package "global" in any of:
/Users/lintao/Documents/Code/GO/src/studygolang/src/vendor/global (vendor tree)
/usr/local/go/src/global (from $GOROOT)
/Users/lintao/Documents/Code/GO/src/global (from $GOPATH)
main.go:11:2: cannot find package "http/controller" in any of:
/Users/lintao/Documents/Code/GO/src/studygolang/src/vendor/http/controller (vendor tree)
/usr/local/go/src/http/controller (from $GOROOT)
我加上完整路径后才能编译通过,我GOROOT环境变量就是设置在Code/GO文件夹下
"studygolang/src/http/controller/admin"

const mainIniPath = "/config/env.ini"
需要去掉前面的/不然有路径问题。

from studygolang.

NSObjects avatar NSObjects commented on May 19, 2024

要手动加是goimports,gofmt都不起作用。。。

from studygolang.

polaris1119 avatar polaris1119 commented on May 19, 2024

install.sh 后,为啥执行 go run main.go ,应该执行 bin/studygolang

from studygolang.

hiyanxu avatar hiyanxu commented on May 19, 2024

根据和大神@polaris1119的沟通,studygolang是一个独立的项目,不可以放到$GOPATH下的src目录下,修改后就可以运行了

from studygolang.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.