Comments (2)
这个修改一下就可以了response.Rate.Remaining
from x-patrol.
github.com/google/go-github/github
更新过了,数据结构有变化:
hartnett at hartnettdeMacBook-Pro in /data/code/golang/src/x-patrol (mi_dev)
$ go build main.go
hartnett at hartnettdeMacBook-Pro in /data/code/golang/src/x-patrol (mi_dev)
$ go get -u github.com/google/go-github/github
# cd /data/code/golang/src/github.com/google/go-github; git pull --ff-only
From https://github.com/google/go-github
922ceac..8d8132c master -> origin/master
* [new branch] revert-844-teamreview -> origin/revert-844-teamreview
* [new tag] v10.0.0 -> v10.0.0
* [new tag] v11.0.0 -> v11.0.0
* [new tag] v12.0.0 -> v12.0.0
* [new tag] v13.0.0 -> v13.0.0
* [new tag] v14.0.0 -> v14.0.0
* [new tag] v2.0.0 -> v2.0.0
* [new tag] v3.0.0 -> v3.0.0
* [new tag] v4.0.0 -> v4.0.0
* [new tag] v5.0.0 -> v5.0.0
* [new tag] v6.0.0 -> v6.0.0
* [new tag] v7.0.0 -> v7.0.0
* [new tag] v8.0.0 -> v8.0.0
* [new tag] v9.0.0 -> v9.0.0
* [new tag] v15.0.0 -> v15.0.0
* [new tag] v16.0.0 -> v16.0.0
* [new tag] v17.0.0 -> v17.0.0
* [new tag] v18.0.0 -> v18.0.0
* [new tag] v18.1.0 -> v18.1.0
* [new tag] v18.2.0 -> v18.2.0
* [new tag] v19.0.0 -> v19.0.0
* [new tag] v19.1.0 -> v19.1.0
error: Your local changes to the following files would be overwritten by merge:
github/github.go
github/search.go
Please commit your changes or stash them before you merge.
Aborting
Updating 922ceac..8d8132c
package github.com/google/go-github/github: exit status 1
hartnett at hartnettdeMacBook-Pro in /data/code/golang/src/x-patrol (mi_dev)
$ rm -fr ../github.com/google/go-github
hartnett at hartnettdeMacBook-Pro in /data/code/golang/src/x-patrol (mi_dev)
$ go get -u github.com/google/go-github/github
hartnett at hartnettdeMacBook-Pro in /data/code/golang/src/x-patrol (mi_dev)
$ go build main.go
# x-patrol/models
models/github.go:97:35: response.Remaining undefined (type *github.Response has no field or method Remaining)
models/github.go:98:31: response.Reset undefined (type *github.Response has no field or method Reset)
models/github.go:99:31: response.Limit undefined (type *github.Response has no field or method Limit)
将models/github.go
中的代码改为以下就可以了:
func UpdateRate(token string, response *github.Response) (error) {
githubToken := new(GithubToken)
has, err := Engine.Table("github_token").Where("token=?", token).Get(githubToken)
if err == nil && has {
id := githubToken.Id
githubToken.Remaining = response.Rate.Remaining
githubToken.Reset = response.Rate.Reset.Time
githubToken.Limit = response.Rate.Limit
Engine.ID(id).Update(githubToken)
}
return err
}
util/githubsearch/gitclient.go:160:文件中相应的地方也要修改
$ go get -u github.com/google/go-github/github
hartnett at hartnettdeMacBook-Pro in /data/code/golang/src/x-patrol (mi_dev)
$ go build main.go
# x-patrol/models
models/github.go:97:35: response.Remaining undefined (type *github.Response has no field or method Remaining)
models/github.go:98:31: response.Reset undefined (type *github.Response has no field or method Reset)
models/github.go:99:31: response.Limit undefined (type *github.Response has no field or method Limit)
hartnett at hartnettdeMacBook-Pro in /data/code/golang/src/x-patrol (mi_dev)
$ go build main.go
# x-patrol/util/githubsearch
util/githubsearch/gitclient.go:160:10: resp.Remaining undefined (type *github.Response has no field or method Remaining)
hartnett at hartnettdeMacBook-Pro in /data/code/golang/src/x-patrol (mi_dev)
$ go build main.go
from x-patrol.
Related Issues (20)
- 本地仓库搜索报错 HOT 1
- 403 You have triggered an abuse detection mechanism. Please wait a few minutes before you try again HOT 2
- error while running go-get HOT 1
- 全局搜索关键字 HOT 1
- build报错 HOT 3
- 代码扫描不全 HOT 3
- scan功能一直提示空指针,go语言不知道怎么修改,求大佬指点 HOT 1
- 功能咨询 HOT 4
- 一运行就panic HOT 3
- Error: cannot load github.com/etsy/hound/codesearch/sparse HOT 1
- cannot load github.com/hound-search/hound/codesearch/sparse HOT 15
- 希望可以有一个搭建文档,和一个新手问题解决如果有那就太棒了 HOT 1
- 运行无结果 HOT 2
- Potential case-insensitive import collision
- 401 Bad credentials
- 想运行下看看效果真是难
- 嗨,已忽略的仓库,下次scan还会被扫描出来吗 HOT 1
- 我总结了个搭建文档
- 求助如何解决,感谢 HOT 1
- 添加github账户一直报502错误。这是什么原因啊
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from x-patrol.