Go——go服务监控、包引用冲突

 

1、http://xxx.com/metrics

 

2、http://xxx.com/debug/pprof/

 

3、包冲突问题

cloud.google.com/go/compute/metadata: ambiguous import: found package cloud.google.com/go/compute/metadata in multiple modules:
cloud.google.com/go v0.81.0 (C:\Users\Administrator\go\pkg\mod\cloud.google.com\go@v0.81.0\compute\metadata)
cloud.google.com/go/compute/metadata v0.2.3 (C:\Users\Administrator\go\pkg\mod\cloud.google.com\go\compute\metadata@v0.2.3)

解决办法:

go get cloud.google.com/go/compute/metadata

go mod tidy  (某些环境只能执行一次,好了就行了; 多次执行问题还会出现。)

 

posted @ 2023-12-29 15:43  会飞的斧头  阅读(103)  评论(0编辑  收藏  举报