/api/status 接口报错。 mac m1上
minr opened this issue · comments
请求:
curl -H "Content-Type:application/json" -X GET http://127.0.0.1:5678/api/status
{"state":false,"message":"runtime error: index out of range [0] with length 0"}
goroutine 39 [running]:
runtime/debug.Stack()
/opt/hostedtoolcache/go/1.18.5/x64/src/runtime/debug/stack.go:24 +0x68
runtime/debug.PrintStack()
/opt/hostedtoolcache/go/1.18.5/x64/src/runtime/debug/stack.go:16 +0x20
gofound/web/middleware.Exception.func1.1()
/home/runner/work/gofound/gofound/web/middleware/exception.go:15 +0x40
panic({0x10178b720, 0x14002e19ec0})
/opt/hostedtoolcache/go/1.18.5/x64/src/runtime/panic.go:838 +0x204
gofound/searcher/system.GetCPUStatus()
/home/runner/work/gofound/gofound/searcher/system/cpu.go:19 +0xd0
gofound/web/service.(*Base).Status(0x14000067100)
/home/runner/work/gofound/gofound/web/service/base.go:44 +0x10c
gofound/web/controller.Status(0x14000071630?)
/home/runner/work/gofound/gofound/web/controller/base.go:39 +0x38
github.com/gin-gonic/gin.(*Context).Next(...)
/home/runner/go/pkg/mod/github.com/gin-gonic/gin@v1.7.7/context.go:168
gofound/web/middleware.Exception.func1(0x1400017c300)
/home/runner/work/gofound/gofound/web/middleware/exception.go:20 +0x6c
github.com/gin-gonic/gin.(*Context).Next(...)
/home/runner/go/pkg/mod/github.com/gin-gonic/gin@v1.7.7/context.go:168
gofound/web/middleware.Cors.func1(0x1400017c300)
/home/runner/work/gofound/gofound/web/middleware/cors.go:25 +0x140
github.com/gin-gonic/gin.(*Context).Next(...)
/home/runner/go/pkg/mod/github.com/gin-gonic/gin@v1.7.7/context.go:168
github.com/gin-gonic/gin.CustomRecoveryWithWriter.func1(0x1400017c300)
/home/runner/go/pkg/mod/github.com/gin-gonic/gin@v1.7.7/recovery.go:99 +0x80
github.com/gin-gonic/gin.(*Context).Next(...)
/home/runner/go/pkg/mod/github.com/gin-gonic/gin@v1.7.7/context.go:168
github.com/gin-gonic/gin.LoggerWithConfig.func1(0x1400017c300)
/home/runner/go/pkg/mod/github.com/gin-gonic/gin@v1.7.7/logger.go:241 +0xb0
github.com/gin-gonic/gin.(*Context).Next(...)
/home/runner/go/pkg/mod/github.com/gin-gonic/gin@v1.7.7/context.go:168
github.com/gin-gonic/gin.(*Engine).handleHTTPRequest(0x140052b1040, 0x1400017c300)
/home/runner/go/pkg/mod/github.com/gin-gonic/gin@v1.7.7/gin.go:555 +0x568
github.com/gin-gonic/gin.(*Engine).ServeHTTP(0x140052b1040, {0x1017ccf80?, 0x140002781c0}, 0x1400017c000)
/home/runner/go/pkg/mod/github.com/gin-gonic/gin@v1.7.7/gin.go:511 +0x1d4
net/http.serverHandler.ServeHTTP({0x140002c81e0?}, {0x1017ccf80, 0x140002781c0}, 0x1400017c000)
/opt/hostedtoolcache/go/1.18.5/x64/src/net/http/server.go:2916 +0x3fc
net/http.(*conn).serve(0x1400032a000, {0x1017cd6e8, 0x140051c5f50})
/opt/hostedtoolcache/go/1.18.5/x64/src/net/http/server.go:1966 +0x56c
created by net/http.(*Server).Serve
/opt/hostedtoolcache/go/1.18.5/x64/src/net/http/server.go:3071 +0x450
[GIN] 2022/11/02 - 16:31:23 | 200 | 9.7025ms | 127.0.0.1 | GET "/api/status"
来自24年的留言,m2系统,最新版的releases同样的报错,有点疑惑
来自24年的留言,m2系统,最新版的releases同样的报错,有点疑惑
自己编译源码即可解决