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

请教下如何布置环境 #10

Open
WX2012 opened this issue Dec 4, 2017 · 7 comments
Open

请教下如何布置环境 #10

WX2012 opened this issue Dec 4, 2017 · 7 comments

Comments

@WX2012
Copy link

WX2012 commented Dec 4, 2017

抱歉占用你的精力,不是太了解这个要怎么配置,如果方便的话,是否能告知我一下。谢谢

@adyzng
Copy link
Owner

adyzng commented Dec 5, 2017

Release binary

或者

  1. Golang安装包

  2. go get 几个依赖的包

go get github.com/go-clog/clog
go get github.com/PuerkitoBio/goquery
go get github.com/axgle/mahonia
go get github.com/bitly/go-simplejson
  1. Build
go build 

@WX2012
Copy link
Author

WX2012 commented Dec 5, 2017

感谢你的回复,我先安装好了Go,也go get了下面这几个依赖的包。在安装到第二个goquery包的时候,因为用go get 安装 golang 官方包失败,我挂了VPN美国区的也不行。

最后按照这个帖子的方法,http://www.bubuko.com/infodetail-2295919.html
安装了net包
然后再继续安装goquery和后面两个依赖的包成功

在第三步,我执行go build时,提示can't load package: package .: no Go files in /Users/xxx

请问这个是因为什么原因?是我哪里没有配置好吗?

我的.bash_profile文件配置如下:
export GOROOT=/usr/local/go
export GOPATH=/Users/hope/go
export GOBIN=$GOPATH/bin
export PATH=$PATH:$GOROOT/bin:$GOPATH/bin

请问是否有错误?go env看到的配置结果如下:
GOARCH="amd64"
GOBIN="/Users/hope/go/bin"
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
GOPATH="/Users/xxx/go"
GORACE=""
GOROOT="/usr/local/go"
GOTOOLDIR="/usr/local/go/pkg/tool/darwin_amd64"
GCCGO="gccgo"
CC="clang"
GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/tq/930vws5966l060_b4rnt5_2m0000gn/T/go-build769058605=/tmp/go-build -gno-record-gcc-switches -fno-common"
CXX="clang++"
CGO_ENABLED="1"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"

非常感谢,新手学习中,给您添麻烦了。谢谢

@adyzng
Copy link
Owner

adyzng commented Dec 6, 2017

应该Clone到这个目录下:
$GOPATH/src/github.com/adyzng/go-jd

@WX2012
Copy link
Author

WX2012 commented Dec 6, 2017

感谢回复,但我没看到github.com目录下有这个adyzng这个,是否要新建一个adyzng文件夹,将您的那个go-jd-1.0.zip解压拷到此文件夹中?

我的.bash_Profile文件内容这样配置可对?请您指点。非常感谢
github
github2

@adyzng
Copy link
Owner

adyzng commented Dec 6, 2017

用 go get 下载,不用手动现在.zip

go get github.com/adyzng/go-jd

@WX2012
Copy link
Author

WX2012 commented Dec 13, 2017

谢谢,这几天在外面出差。回去测试下。感谢回复

@xufeiwu123
Copy link

请问下这个怎么用

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants