tophubs / toplist Goto Github PK
View Code? Open in Web Editor NEW今日热榜,一个获取各大热门网站热门头条的聚合网站,使用Go语言编写,多协程异步快速抓取信息,预览:https://mo.fish
License: Apache License 2.0
今日热榜,一个获取各大热门网站热门头条的聚合网站,使用Go语言编写,多协程异步快速抓取信息,预览:https://mo.fish
License: Apache License 2.0
parse mysql config once. filePath: D:\go-workspace\TopList\Config\mysql.toml
2019/09/26 15:01:52 err
2019/09/26 15:01:52 http: panic serving [::1]:62895: runtime error: invalid memory address or nil pointer dereference
goroutine 21 [running]:
net/http.(*conn).serve.func1(0xc00005ec80)
C:/Go/src/net/http/server.go:1769 +0xd0
panic(0x7d7f00, 0xb6ac20)
C:/Go/src/runtime/panic.go:522 +0x1c3
text/template.errRecover(0xc00007bc20)
C:/Go/src/text/template/exec.go:160 +0x1d4
panic(0x7d7f00, 0xb6ac20)
C:/Go/src/runtime/panic.go:522 +0x1c3
text/template.(*Template).execute(0x0, 0x8c9060, 0xc000126000, 0x0, 0x0, 0x0, 0x0)
C:/Go/src/text/template/exec.go:214 +0x1a9
text/template.(*Template).Execute(...)
C:/Go/src/text/template/exec.go:200
main.main.func1(0x8d0020, 0xc000126000, 0xc000112000)
D:/go-workspace/TopList/App/Server.go:72 +0xd0
net/http.HandlerFunc.ServeHTTP(0x85d398, 0x8d0020, 0xc000126000, 0xc000112000)
C:/Go/src/net/http/server.go:1995 +0x4b
net/http.(*ServeMux).ServeHTTP(0xb77500, 0x8d0020, 0xc000126000, 0xc000112000)
C:/Go/src/net/http/server.go:2375 +0x1dd
net/http.serverHandler.ServeHTTP(0xc00005c9c0, 0x8d0020, 0xc000126000, 0xc000112000)
C:/Go/src/net/http/server.go:2774 +0xb2
net/http.(*conn).serve(0xc00005ec80, 0x8d08e0, 0xc000104040)
C:/Go/src/net/http/server.go:1878 +0x853
created by net/http.(*Server).Serve
C:/Go/src/net/http/server.go:2884 +0x2fb
2019/09/26 15:01:52 err
2019/09/26 15:01:52 http: panic serving [::1]:62896: runtime error: invalid memory address or nil pointer dereference
goroutine 35 [running]:
net/http.(*conn).serve.func1(0xc000164000)
C:/Go/src/net/http/server.go:1769 +0xd0
panic(0x7d7f00, 0xb6ac20)
C:/Go/src/runtime/panic.go:522 +0x1c3
text/template.errRecover(0xc0000f7c20)
C:/Go/src/text/template/exec.go:160 +0x1d4
panic(0x7d7f00, 0xb6ac20)
C:/Go/src/runtime/panic.go:522 +0x1c3
text/template.(*Template).execute(0x0, 0x8c9060, 0xc000176000, 0x0, 0x0, 0x0, 0x0)
C:/Go/src/text/template/exec.go:214 +0x1a9
text/template.(*Template).Execute(...)
C:/Go/src/text/template/exec.go:200
main.main.func1(0x8d0020, 0xc000176000, 0xc00016a000)
D:/go-workspace/TopList/App/Server.go:72 +0xd0
net/http.HandlerFunc.ServeHTTP(0x85d398, 0x8d0020, 0xc000176000, 0xc00016a000)
C:/Go/src/net/http/server.go:1995 +0x4b
net/http.(*ServeMux).ServeHTTP(0xb77500, 0x8d0020, 0xc000176000, 0xc00016a000)
C:/Go/src/net/http/server.go:2375 +0x1dd
net/http.serverHandler.ServeHTTP(0xc00005c9c0, 0x8d0020, 0xc000176000, 0xc00016a000)
C:/Go/src/net/http/server.go:2774 +0xb2
net/http.(*conn).serve(0xc000164000, 0x8d08e0, 0xc0000180c0)
C:/Go/src/net/http/server.go:1878 +0x853
created by net/http.(*Server).Serve
C:/Go/src/net/http/server.go:2884 +0x2fb
2019/09/26 15:01:57 err
2019/09/26 15:01:57 http: panic serving [::1]:62897: runtime error: invalid memory address or nil pointer dereference
goroutine 22 [running]:
net/http.(*conn).serve.func1(0xc00005ed20)
C:/Go/src/net/http/server.go:1769 +0xd0
panic(0x7d7f00, 0xb6ac20)
C:/Go/src/runtime/panic.go:522 +0x1c3
text/template.errRecover(0xc0000f9c20)
C:/Go/src/text/template/exec.go:160 +0x1d4
panic(0x7d7f00, 0xb6ac20)
C:/Go/src/runtime/panic.go:522 +0x1c3
text/template.(*Template).execute(0x0, 0x8c9060, 0xc0001760e0, 0x0, 0x0, 0x0, 0x0)
C:/Go/src/text/template/exec.go:214 +0x1a9
text/template.(*Template).Execute(...)
C:/Go/src/text/template/exec.go:200
main.main.func1(0x8d0020, 0xc0001760e0, 0xc00016a100)
D:/go-workspace/TopList/App/Server.go:72 +0xd0
net/http.HandlerFunc.ServeHTTP(0x85d398, 0x8d0020, 0xc0001760e0, 0xc00016a100)
C:/Go/src/net/http/server.go:1995 +0x4b
net/http.(*ServeMux).ServeHTTP(0xb77500, 0x8d0020, 0xc0001760e0, 0xc00016a100)
C:/Go/src/net/http/server.go:2375 +0x1dd
net/http.serverHandler.ServeHTTP(0xc00005c9c0, 0x8d0020, 0xc0001760e0, 0xc00016a100)
C:/Go/src/net/http/server.go:2774 +0xb2
net/http.(*conn).serve(0xc00005ed20, 0x8d08e0, 0xc000018280)
C:/Go/src/net/http/server.go:1878 +0x853
created by net/http.(*Server).Serve
C:/Go/src/net/http/server.go:2884 +0x2fb
2019/09/26 15:02:27 err
2019/09/26 15:02:27 http: panic serving [::1]:62902: runtime error: invalid memory address or nil pointer dereference
goroutine 6 [running]:
net/http.(*conn).serve.func1(0xc00016e0a0)
C:/Go/src/net/http/server.go:1769 +0xd0
panic(0x7d7f00, 0xb6ac20)
C:/Go/src/runtime/panic.go:522 +0x1c3
text/template.errRecover(0xc0000f9c20)
C:/Go/src/text/template/exec.go:160 +0x1d4
panic(0x7d7f00, 0xb6ac20)
C:/Go/src/runtime/panic.go:522 +0x1c3
text/template.(*Template).execute(0x0, 0x8c9060, 0xc0001b0000, 0x0, 0x0, 0x0, 0x0)
C:/Go/src/text/template/exec.go:214 +0x1a9
text/template.(*Template).Execute(...)
C:/Go/src/text/template/exec.go:200
main.main.func1(0x8d0020, 0xc0001b0000, 0xc0001aa000)
D:/go-workspace/TopList/App/Server.go:72 +0xd0
net/http.HandlerFunc.ServeHTTP(0x85d398, 0x8d0020, 0xc0001b0000, 0xc0001aa000)
C:/Go/src/net/http/server.go:1995 +0x4b
net/http.(*ServeMux).ServeHTTP(0xb77500, 0x8d0020, 0xc0001b0000, 0xc0001aa000)
C:/Go/src/net/http/server.go:2375 +0x1dd
net/http.serverHandler.ServeHTTP(0xc00005c9c0, 0x8d0020, 0xc0001b0000, 0xc0001aa000)
C:/Go/src/net/http/server.go:2774 +0xb2
net/http.(*conn).serve(0xc00016e0a0, 0x8d08e0, 0xc000060580)
C:/Go/src/net/http/server.go:1878 +0x853
created by net/http.(*Server).Serve
C:/Go/src/net/http/server.go:2884 +0x2fb
2019/09/26 15:03:27 err
2019/09/26 15:03:27 http: panic serving [::1]:62909: runtime error: invalid memory address or nil pointer dereference
goroutine 7 [running]:
net/http.(*conn).serve.func1(0xc00016e140)
C:/Go/src/net/http/server.go:1769 +0xd0
panic(0x7d7f00, 0xb6ac20)
C:/Go/src/runtime/panic.go:522 +0x1c3
text/template.errRecover(0xc0000f7c20)
C:/Go/src/text/template/exec.go:160 +0x1d4
panic(0x7d7f00, 0xb6ac20)
C:/Go/src/runtime/panic.go:522 +0x1c3
text/template.(*Template).execute(0x0, 0x8c9060, 0xc0001b00e0, 0x0, 0x0, 0x0, 0x0)
C:/Go/src/text/template/exec.go:214 +0x1a9
text/template.(*Template).Execute(...)
C:/Go/src/text/template/exec.go:200
main.main.func1(0x8d0020, 0xc0001b00e0, 0xc0001aa100)
D:/go-workspace/TopList/App/Server.go:72 +0xd0
net/http.HandlerFunc.ServeHTTP(0x85d398, 0x8d0020, 0xc0001b00e0, 0xc0001aa100)
C:/Go/src/net/http/server.go:1995 +0x4b
net/http.(*ServeMux).ServeHTTP(0xb77500, 0x8d0020, 0xc0001b00e0, 0xc0001aa100)
C:/Go/src/net/http/server.go:2375 +0x1dd
net/http.serverHandler.ServeHTTP(0xc00005c9c0, 0x8d0020, 0xc0001b00e0, 0xc0001aa100)
C:/Go/src/net/http/server.go:2774 +0xb2
net/http.(*conn).serve(0xc00016e140, 0x8d08e0, 0xc0000606c0)
C:/Go/src/net/http/server.go:1878 +0x853
created by net/http.(*Server).Serve
C:/Go/src/net/http/server.go:2884 +0x2fb
2019/09/26 15:06:33 err
2019/09/26 15:06:33 http: panic serving [::1]:62943: runtime error: invalid memory address or nil pointer dereference
goroutine 25 [running]:
net/http.(*conn).serve.func1(0xc00005ef00)
C:/Go/src/net/http/server.go:1769 +0xd0
panic(0x7d7f00, 0xb6ac20)
C:/Go/src/runtime/panic.go:522 +0x1c3
text/template.errRecover(0xc00007bc20)
C:/Go/src/text/template/exec.go:160 +0x1d4
panic(0x7d7f00, 0xb6ac20)
C:/Go/src/runtime/panic.go:522 +0x1c3
text/template.(*Template).execute(0x0, 0x8c9060, 0xc0001762a0, 0x0, 0x0, 0x0, 0x0)
C:/Go/src/text/template/exec.go:214 +0x1a9
text/template.(*Template).Execute(...)
C:/Go/src/text/template/exec.go:200
main.main.func1(0x8d0020, 0xc0001762a0, 0xc00016a400)
D:/go-workspace/TopList/App/Server.go:72 +0xd0
net/http.HandlerFunc.ServeHTTP(0x85d398, 0x8d0020, 0xc0001762a0, 0xc00016a400)
C:/Go/src/net/http/server.go:1995 +0x4b
net/http.(*ServeMux).ServeHTTP(0xb77500, 0x8d0020, 0xc0001762a0, 0xc00016a400)
C:/Go/src/net/http/server.go:2375 +0x1dd
net/http.serverHandler.ServeHTTP(0xc00005c9c0, 0x8d0020, 0xc0001762a0, 0xc00016a400)
C:/Go/src/net/http/server.go:2774 +0xb2
net/http.(*conn).serve(0xc00005ef00, 0x8d08e0, 0xc000018380)
C:/Go/src/net/http/server.go:1878 +0x853
created by net/http.(*Server).Serve
C:/Go/src/net/http/server.go:2884 +0x2fb
2019/09/26 15:06:33 err
2019/09/26 15:06:33 http: panic serving [::1]:62945: runtime error: invalid memory address or nil pointer dereference
goroutine 13 [running]:
net/http.(*conn).serve.func1(0xc00016e320)
C:/Go/src/net/http/server.go:1769 +0xd0
panic(0x7d7f00, 0xb6ac20)
C:/Go/src/runtime/panic.go:522 +0x1c3
text/template.errRecover(0xc0001b5c20)
C:/Go/src/text/template/exec.go:160 +0x1d4
panic(0x7d7f00, 0xb6ac20)
C:/Go/src/runtime/panic.go:522 +0x1c3
text/template.(*Template).execute(0x0, 0x8c9060, 0xc0001260e0, 0x0, 0x0, 0x0, 0x0)
C:/Go/src/text/template/exec.go:214 +0x1a9
text/template.(*Template).Execute(...)
C:/Go/src/text/template/exec.go:200
main.main.func1(0x8d0020, 0xc0001260e0, 0xc000112200)
D:/go-workspace/TopList/App/Server.go:72 +0xd0
net/http.HandlerFunc.ServeHTTP(0x85d398, 0x8d0020, 0xc0001260e0, 0xc000112200)
C:/Go/src/net/http/server.go:1995 +0x4b
net/http.(*ServeMux).ServeHTTP(0xb77500, 0x8d0020, 0xc0001260e0, 0xc000112200)
C:/Go/src/net/http/server.go:2375 +0x1dd
net/http.serverHandler.ServeHTTP(0xc00005c9c0, 0x8d0020, 0xc0001260e0, 0xc000112200)
C:/Go/src/net/http/server.go:2774 +0xb2
net/http.(*conn).serve(0xc00016e320, 0x8d08e0, 0xc000104340)
C:/Go/src/net/http/server.go:1878 +0x853
created by net/http.(*Server).Serve
C:/Go/src/net/http/server.go:2884 +0x2fb
当在浏览器输入localhost:9090时报错。localhost:9090/GetType正常。
定时任务放在golang程序内,可以更容易的启动和监听
一点建议不知是否可以contribute
已fork, 准备使用接口实现一个微信小程序版本
$ go build -o ./App/Server App/Server.go
build /C/go_projects/TopList/Config: cannot find module for path /C/go_projects/TopList/Config
环境:ubuntu 16.04 go语言:go version go1.13.1 linux/amd64
错误信息:
parse mysql config once. filePath: /home/tonyzhang/data/web/go/top/Config/mysql.toml
2019/10/08 13:03:40 err
2019/10/08 13:03:40 http: panic serving 192.168.99.198:5810: runtime error: invalid memory address or nil pointer dereference
goroutine 21 [running]:
net/http.(*conn).serve.func1(0xc0000bcc80)
/home/tonyzhang/data/go/src/net/http/server.go:1767 +0x139
panic(0x7fe6c0, 0xba3450)
/home/tonyzhang/data/go/src/runtime/panic.go:679 +0x1b2
text/template.errRecover(0xc000165b48)
/home/tonyzhang/data/go/src/text/template/exec.go:164 +0x1cb
panic(0x7fe6c0, 0xba3450)
/home/tonyzhang/data/go/src/runtime/panic.go:679 +0x1b2
text/template.(*Template).execute(0x0, 0x902920, 0xc000152000, 0x0, 0x0, 0x0, 0x0)
/home/tonyzhang/data/go/src/text/template/exec.go:218 +0x1c1
text/template.(*Template).Execute(...)
/home/tonyzhang/data/go/src/text/template/exec.go:204
main.main.func1(0x909960, 0xc000152000, 0xc000144000)
/home/tonyzhang/data/web/go/top/App/Server.go:72 +0xc7
net/http.HandlerFunc.ServeHTTP(0x88ff88, 0x909960, 0xc000152000, 0xc000144000)
/home/tonyzhang/data/go/src/net/http/server.go:2007 +0x44
net/http.(*ServeMux).ServeHTTP(0xbb09c0, 0x909960, 0xc000152000, 0xc000144000)
/home/tonyzhang/data/go/src/net/http/server.go:2387 +0x1bd
net/http.serverHandler.ServeHTTP(0xc000112000, 0x909960, 0xc000152000, 0xc000144000)
/home/tonyzhang/data/go/src/net/http/server.go:2802 +0xa4
net/http.(*conn).serve(0xc0000bcc80, 0x90a620, 0xc00013a000)
/home/tonyzhang/data/go/src/net/http/server.go:1890 +0x875
created by net/http.(*Server).Serve
/home/tonyzhang/data/go/src/net/http/server.go:2927 +0x38e
$ go build -o ./App/GetHot App/GetHot.go
C:\Users\Eric\go\src\golang.org\x\text\encoding\simplifiedchinese\gbk.go:17:2: cannot use composite literal (type gbk) as type encoding.Encoding in assignment:
gbk does not implement encoding.Encoding (wrong type for NewDecoder method)
have NewDecoder() "golang.org/x/text/transform".Transformer
want NewDecoder() "github.com/weisd/golang.org-x-text/transform".Transformer
C:\Users\Eric\go\src\golang.org\x\text\encoding\simplifiedchinese\gbk.go:20:2: cannot use composite literal (type gbk) as type encoding.Encoding in assignment:
gbk does not implement encoding.Encoding (wrong type for NewDecoder method)
have NewDecoder() "golang.org/x/text/transform".Transformer
want NewDecoder() "github.com/weisd/golang.org-x-text/transform".Transformer
C:\Users\Eric\go\src\golang.org\x\text\encoding\simplifiedchinese\hzgb2312.go:16:5: cannot use composite literal (type hzGB2312) as type encoding.Encoding in assignment:
hzGB2312 does not implement encoding.Encoding (wrong type for NewDecoder method)
have NewDecoder() "golang.org/x/text/transform".Transformer
want NewDecoder() "github.com/weisd/golang.org-x-text/transform".Transformer
Config\MySql.go:5:2: cannot find package "github.com/BurntSushi/toml" in any of:
D:\Go\src\github.com\BurntSushi\toml (from $GOROOT)
E:\project-example\go-project\src\github.com\BurntSushi\toml (from $GOPATH)
App\GetHot.go:8:2: cannot find package "github.com/PuerkitoBio/goquery" in any of:
D:\Go\src\github.com\PuerkitoBio\goquery (from $GOROOT)
E:\project-example\go-project\src\github.com\PuerkitoBio\goquery (from $GOPATH)
App\GetHot.go:9:2: cannot find package "github.com/bitly/go-simplejson" in any of:
D:\Go\src\github.com\bitly\go-simplejson (from $GOROOT)
E:\project-example\go-project\src\github.com\bitly\go-simplejson (from $GOPATH)
Common\Db.go:7:2: cannot find package "github.com/go-sql-driver/mysql" in any of:
D:\Go\src\github.com\go-sql-driver\mysql (from $GOROOT)
E:\project-example\go-project\src\github.com\go-sql-driver\mysql (from $GOPATH)
App\GetHot.go:10:2: cannot find package "golang.org/x/text/encoding/simplifiedchinese" in any of:
D:\Go\src\golang.org\x\text\encoding\simplifiedchinese (from $GOROOT)
E:\project-example\go-project\src\golang.org\x\text\encoding\simplifiedchinese (from $GOPATH)
App\GetHot.go:11:2: cannot find package "golang.org/x/text/transform" in any of:
D:\Go\src\golang.org\x\text\transform (from $GOROOT)
E:\project-example\go-project\src\golang.org\x\text\transform (from $GOPATH)
请问在windows下是如何配置的,萌新刚接触这个项目,对go和mysql也是新手,因此对大佬
“执行database.sql创建数据库,并配置/Config/Mysql.go数据库连接地址”
的精炼语言不是很理解,没有能够读懂整个安装步骤。看到issue部分感觉大家都能成功运行,所以自己搞了两天,但是并没有能够成功编译,但仍然执着于这个项目。
目前下载了go的idle goland,安装好了mysql,学习了go和mysql语法。
我已看到issue#8相关说明,有木有大佬指导一下哈:)
有道云笔记推荐文章很不错
Hi,
I am not sure how the api working? It seems something missing in this repository, i.e. how GetType/GetTypeInfo to interact with the database?
function getHotInfo() {
$.ajax({
url:ServerIp+"/GetType",
type:"GET",
...
I have got errors since there is no localhost/GetType:
jquery.js:8623 GET http://127.0.0.1/GetType 404 (Not Found)
Please kindly help me with the issue. Thanks a lot!
页面加载不出来36Kr的数据啦,请求鱼塘塘长看看啥情况
进行更多的新闻聚合的完善,增加日期,可以展示历史的每天数据,不确定作者现在每隔多久进行一次爬数据~,
先稳住,放学后搞起来
Chrome 那个默认的强迫症有点受不了了...
平时有用这个网站看新闻 :)
黑客派抓取可考虑使用 API,这样能够提升可用性、降低维护工作量。
希望提供关键字过滤~
如果能提供接口那就好啦
一亩三分地
、简书
...今日头条的TopList是否有难度?
Hi, I don't for what reason, by calling your API got wrong charset...
{Code: 0, Message: è�·å��æ�°æ�®æ��å��, Data: [{id: 1, sort: 161598, title: ç�¥ä¹�}, {id: 2, sort: 59138, title: è��æ��}, {id: 6, sort: 28782, title: 天涯}, {id: 7, sort: 32258, title: ç�¥ä¹�æ�¥æ�¥}, {id: 9, sort: 25802, title: æ°´æ�¨ç¤¾å�º}, {id: 10, sort: 17855, title: ç½�æ��æ�°é�»}, {id: 11, sort: 20552, title: 微信}, {id: 12, sort: 14739, title: 36Kr}, {id: 56, sort: 12948, title: è´´å�§}, {id: 57, sort: 17027, title: è±�ç�£}, {id: 58, sort: 37468, title: å¾®å��}, {id: 59, sort: 53295, title: V2EX}, {id: 60, sort: 16011, title: Segmentfault}, {id: 61, sort: 12711, title: 好å¥�å¿�æ�¥æ�¥}, {id: 62, sort: 13769, title: é»�客派}, {id: 83, sort: 11910, title: ç�¾åº¦ç�æ��}, {id: 85, sort:
Both types and typeinfos. How to solve this? I am using http
inside flutter.
Also, safari brower calling API also wrong charset..
Administrator@WINDOWS-O8ROA6P MINGW32 /e/project-example/go-project
$ go run App/Server.go
parse mysql config once. filePath: E:\project-example\go-project\Config\mysql.toml
panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xc0000005 code=0x1 addr=0x20 pc=0x74c784]
goroutine 1 [running]:
sync.(*Mutex).Lock(...)
D:/Go/src/sync/mutex.go:74
database/sql.(*DB).SetMaxOpenConns(0x0, 0x7d0)
D:/Go/src/database/sql/sql.go:899 +0x34
/E/project-example/go-project/Common.init.0()
E:/project-example/go-project/Common/Db.go:41 +0xe7
exit status 2
Administrator@WINDOWS-O8ROA6P MINGW32 /e/project-example/go-project
能添加国外源吗?
Sent from PPHub
`go.mod
module github.com/tophubs/TopList
go 1.13
require (
github.com/BurntSushi/toml v0.3.1
github.com/PuerkitoBio/goquery v1.5.0
github.com/bitly/go-simplejson v0.5.0
github.com/go-sql-driver/mysql v1.4.1
golang.org/x/crypto v0.0.0-20190829043050-9756ffdc2472 // indirect
golang.org/x/net v0.0.0-20190827160401-ba9fcec4b297 // indirect
golang.org/x/text v0.3.2
google.golang.org/appengine v1.6.2 // indirect
)
`
2019/09/07 18:50:37 err
2019/09/07 18:50:37 http: panic serving 127.0.0.1:38404: runtime error: invalid memory address or nil pointer dereference
goroutine 19 [running]:
net/http.(*conn).serve.func1(0xc0001c2000)
/ssd/go-1.13/src/net/http/server.go:1767 +0x149
panic(0x965020, 0xd15470)
/ssd/go-1.13/src/runtime/panic.go:679 +0x1e0
text/template.errRecover(0xc00009b728)
/ssd/go-1.13/src/text/template/exec.go:164 +0x30d
panic(0x965020, 0xd15470)
/ssd/go-1.13/src/runtime/panic.go:679 +0x1e0
text/template.(*Template).execute(0x0, 0xa60680, 0xc00018e1c0, 0x95b7e0, 0xd3f3b0, 0x0, 0x0)
/ssd/go-1.13/src/text/template/exec.go:218 +0x303
text/template.(*Template).Execute(0x0, 0xa60680, 0xc00018e1c0, 0x95b7e0, 0xd3f3b0, 0x0, 0x0)
/ssd/go-1.13/src/text/template/exec.go:204 +0x5e
main.main.func1(0xa669c0, 0xc00018e1c0, 0xc000132200)
/ssd/mygo/TopList/App/Server.go:74 +0x1e5
net/http.HandlerFunc.ServeHTTP(0x9f9d28, 0xa669c0, 0xc00018e1c0, 0xc000132200)
/ssd/go-1.13/src/net/http/server.go:2007 +0x44
net/http.(*ServeMux).ServeHTTP(0xd229e0, 0xa669c0, 0xc00018e1c0, 0xc000132200)
/ssd/go-1.13/src/net/http/server.go:2387 +0x1a6
net/http.serverHandler.ServeHTTP(0xc0000fc000, 0xa669c0, 0xc00018e1c0, 0xc000132200)
/ssd/go-1.13/src/net/http/server.go:2802 +0x20f
net/http.(*conn).serve(0xc0001c2000, 0xa67540, 0xc00011c200)
/ssd/go-1.13/src/net/http/server.go:1890 +0x1716
created by net/http.(*Server).Serve
/ssd/go-1.13/src/net/http/server.go:2927 +0x911
2019/09/07 18:50:37 err
2019/09/07 18:50:37 http: panic serving 127.0.0.1:38406: runtime error: invalid memory address or nil pointer dereference
goroutine 20 [running]:
net/http.(*conn).serve.func1(0xc0001c20a0)
/ssd/go-1.13/src/net/http/server.go:1767 +0x149
panic(0x965020, 0xd15470)
/ssd/go-1.13/src/runtime/panic.go:679 +0x1e0
text/template.errRecover(0xc000099728)
/ssd/go-1.13/src/text/template/exec.go:164 +0x30d
panic(0x965020, 0xd15470)
/ssd/go-1.13/src/runtime/panic.go:679 +0x1e0
text/template.(*Template).execute(0x0, 0xa60680, 0xc0000fc0e0, 0x95b7e0, 0xd3f3b0, 0x0, 0x0)
/ssd/go-1.13/src/text/template/exec.go:218 +0x303
text/template.(*Template).Execute(0x0, 0xa60680, 0xc0000fc0e0, 0x95b7e0, 0xd3f3b0, 0x0, 0x0)
/ssd/go-1.13/src/text/template/exec.go:204 +0x5e
main.main.func1(0xa669c0, 0xc0000fc0e0, 0xc000132100)
/ssd/mygo/TopList/App/Server.go:74 +0x1e5
net/http.HandlerFunc.ServeHTTP(0x9f9d28, 0xa669c0, 0xc0000fc0e0, 0xc000132100)
/ssd/go-1.13/src/net/http/server.go:2007 +0x44
net/http.(*ServeMux).ServeHTTP(0xd229e0, 0xa669c0, 0xc0000fc0e0, 0xc000132100)
/ssd/go-1.13/src/net/http/server.go:2387 +0x1a6
net/http.serverHandler.ServeHTTP(0xc0000fc000, 0xa669c0, 0xc0000fc0e0, 0xc000132100)
/ssd/go-1.13/src/net/http/server.go:2802 +0x20f
net/http.(*conn).serve(0xc0001c20a0, 0xa67540, 0xc00011c180)
/ssd/go-1.13/src/net/http/server.go:1890 +0x1716
created by net/http.(*Server).Serve
/ssd/go-1.13/src/net/http/server.go:2927 +0x911
2019/09/07 18:50:38 err
2019/09/07 18:50:38 http: panic serving 127.0.0.1:38408: runtime error: invalid memory address or nil pointer dereference
goroutine 11 [running]:
net/http.(*conn).serve.func1(0xc0000acdc0)
/ssd/go-1.13/src/net/http/server.go:1767 +0x149
panic(0x965020, 0xd15470)
/ssd/go-1.13/src/runtime/panic.go:679 +0x1e0
text/template.errRecover(0xc000099728)
/ssd/go-1.13/src/text/template/exec.go:164 +0x30d
panic(0x965020, 0xd15470)
/ssd/go-1.13/src/runtime/panic.go:679 +0x1e0
text/template.(*Template).execute(0x0, 0xa60680, 0xc0000fc1c0, 0x95b7e0, 0xd3f3b0, 0x0, 0x0)
/ssd/go-1.13/src/text/template/exec.go:218 +0x303
text/template.(*Template).Execute(0x0, 0xa60680, 0xc0000fc1c0, 0x95b7e0, 0xd3f3b0, 0x0, 0x0)
/ssd/go-1.13/src/text/template/exec.go:204 +0x5e
main.main.func1(0xa669c0, 0xc0000fc1c0, 0xc00015c100)
/ssd/mygo/TopList/App/Server.go:74 +0x1e5
net/http.HandlerFunc.ServeHTTP(0x9f9d28, 0xa669c0, 0xc0000fc1c0, 0xc00015c100)
/ssd/go-1.13/src/net/http/server.go:2007 +0x44
net/http.(*ServeMux).ServeHTTP(0xd229e0, 0xa669c0, 0xc0000fc1c0, 0xc00015c100)
/ssd/go-1.13/src/net/http/server.go:2387 +0x1a6
net/http.serverHandler.ServeHTTP(0xc0000fc000, 0xa669c0, 0xc0000fc1c0, 0xc00015c100)
/ssd/go-1.13/src/net/http/server.go:2802 +0x20f
net/http.(*conn).serve(0xc0000acdc0, 0xa67540, 0xc000088580)
/ssd/go-1.13/src/net/http/server.go:1890 +0x1716
created by net/http.(*Server).Serve
/ssd/go-1.13/src/net/http/server.go:2927 +0x911
I watched a odd title when I visited your website
配置如下,没有发现错误
Source = "root:123456@tcp(127.0.0.1:3306)/gonews?charset=utf8mb4"
Driver = "mysql"
[root@iZuf6franciex4vdls96ygZ App]# ./Server
parse mysql config once. filePath: /data/go-project/TopList/Config/mysql.toml
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x20 pc=0x759b9d]
goroutine 1 [running]:
sync.(*Mutex).Lock(...)
/data/go/src/sync/mutex.go:74
database/sql.(*DB).SetMaxOpenConns(0x0, 0x7d0)
/data/go/src/database/sql/sql.go:899 +0x2d
_/data/go-project/TopList/Common.init.0()
/data/go-project/TopList/Common/Db.go:41 +0xe0
一脸懵
在window上会报 syscall.SIGUSR1 无法编译。那么在window可以运行代码吗?
Is there anyway to get website icon? Like this website does: https://tophub.today/
Hi,
Is it possible to add an additional param to control max number of items being returned by GetTypeInfo api?
e.g.
https://www.printf520.com:8080/GetTypeInfo?id=2&&limit=10
It would be very helpful when call this api. Thanks!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.