Prevent crashes on Windows from wonky CPU values #70
This commit is contained in:
parent
20a90672d6
commit
ffbd8828dc
|
@ -23,7 +23,11 @@ func init() {
|
|||
}
|
||||
for i := 0; i < len(vals); i++ {
|
||||
key := fmt.Sprintf(formatString, i)
|
||||
cpus[key] = int(vals[i])
|
||||
v := vals[i]
|
||||
if v > 100 {
|
||||
v = 100
|
||||
}
|
||||
cpus[key] = int(v)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
|
|
@ -26,3 +26,10 @@ Nix adds new and interesting complexities to the release.
|
|||
6. Update the version and hash in nixpkgs/pkgs/tools/system/gotop/default.nix
|
||||
8. In docker, install & run vgo2nix to update deps.nix
|
||||
7. nix-build -A gotop
|
||||
|
||||
|
||||
For plugin development:
|
||||
```
|
||||
V=$(git show -s --format=%cI HEAD | cut -b -19 | tr -cd '[:digit:]')-$(git rev-parse HEAD | cut -b -12)
|
||||
go build -ldflags "-X main.Version=$V" -o gotop ./cmd/gotop
|
||||
```
|
||||
|
|
Loading…
Reference in New Issue
Block a user