Git Product home page Git Product logo

toplist's People

Contributors

1nfrastr avatar hellokaton avatar timeromantic avatar xutaoa avatar yihong0618 avatar yrong avatar zqhong avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

toplist's Issues

Wonderful work! But Flutter side client got wrong charset

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..

image

优化建议

  • 可以考虑用github.com/robfig/cron来实现定时获取, 不用linux的crontab, 部署更简单.
  • httpClient的初始化可以写一个公共的方法, 避免重复代码.

如何在windows下启动服务

请问在windows下是如何配置的,萌新刚接触这个项目,对go和mysql也是新手,因此对大佬
“执行database.sql创建数据库,并配置/Config/Mysql.go数据库连接地址”的精炼语言不是很理解,没有能够读懂整个安装步骤。看到issue部分感觉大家都能成功运行,所以自己搞了两天,但是并没有能够成功编译,但仍然执着于这个项目。

目前下载了go的idle goland,安装好了mysql,学习了go和mysql语法。
我已看到issue#8相关说明,有木有大佬指导一下哈:)

runtime error: invalid memory address or nil pointer dereference

环境: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

开发环境运行调试报错

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正常。

How to make GetType/GetTypeInfo work?

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!

运行报错

[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

部分 go 版本的 需要修改一下配置文件Mysql.go

部分版本中的 strings.ReplaceAll 没有, 可以使用 strings.Replace(string, string, string, int) 替代,
比如

image

可以改成

strings.HasSuffix(currentPath, "App") {
   	return strings.Replace(currentPath, "App", "Config", -1) + "/mysql.toml"
   }

以支持

执行server hotget 都报错

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

编译报错

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)

新增目录

  • 建议增加以下网站的目录:一亩三分地简书...
  • 此外,建议可以增加子目录,如微信、微博等受众较广的,可以按内容分类细化。

console error when open page http://localhost:9090/

`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

热榜不错

希望提供关键字过滤~
如果能提供接口那就好啦

编译报错

$ go build -o ./App/GetHot App/GetHot.go

golang.org/x/text/encoding/simplifiedchinese

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

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.