Commit Graph

154 Commits (cefed482449c50c4a677bc72e18679067878997c)

Author SHA1 Message Date
Matthieu MOREL cefed48244 chore: enable staticcheck linter
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
2 weeks ago
shirou 7b14b866f1
Merge pull request #1783 from mmorel-35/revive/unused-parameter
chore: enable unused-parameter from revive
2 months ago
shirou 9d29c70c52
Merge pull request #1813 from mmorel-35/gocritic
chore: enable gocritic linter
2 months ago
shirou 2ab27a0ba3
Merge pull request #1817 from mmorel-35/revive/var-naming
chore: enable var-naming from revive
2 months ago
Matthieu MOREL dfdd90ab72 chore: enable gocritic linter 2 months ago
Matthieu MOREL 9925fd41ec chore: enable var-naming from revive
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
2 months ago
Matthieu MOREL dc9b409803 chore: enable unused-parameter from revive
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
2 months ago
Matthieu MOREL a5e496769c chore: enable begin rule from thelper
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
2 months ago
Matthieu MOREL 8c1a718a5d chore: use testify instead of testing
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
2 months ago
shirou 8897eba676 [windows]: fix lint error about use-any 3 months ago
shirou 22889d3f13
Merge pull request #1784 from mmorel-35/revive/use-any
chore: enable use-any from revive
3 months ago
Matthieu MOREL 9ce2ec161e chore: enable golangci-lint on Windows and MacOS
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
3 months ago
Matthieu MOREL 27ea38b5ad chore: enable use-any from revive
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
3 months ago
uubulb 1f39525d2d refactor(darwin): optimize string allocation 4 months ago
Matthieu MOREL 7e19b35f50 enable all rules of perfsprint linter
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
5 months ago
uubulb 9e6efdb991 update disk & cpu & process 8 months ago
uubulb 701a74be41 feat(cpu, mem, sensors)(darwin): cgo-free implementations 8 months ago
shirou 37f531010d fix golangcilint errors, ignore gosec G115 9 months ago
shirou 1221983189 [windows][mem]: change to use Performance Counter on SwapMemory. 10 months ago
Niv Govrin 97351d2736 fix: remove tab in empty line 11 months ago
Niv Govrin b6c524eda4
Merge branch 'shirou:master' into patch-1 11 months ago
shirou bc060cc227 add SPDX License, remove old build tag, and replace import 12 months ago
Niv Govrin aa0b73dc6d
fix: return boot time from stat file
add missing return statement for boot time value retrieved from stat file. Also move current time fetch to be closer to where the "time since boot file" is read
12 months ago
camcui 3ec3f55280 chore: fix some typos in comments
Signed-off-by: camcui <cuishua@sina.cn>
1 year ago
shirou 9de1a429b9
Merge pull request #1585 from DataDog/bryce.kahle/os-release-version-id
use VERSION_ID from os-release
1 year ago
Bryce Kahle d753f78612
use VERSION_ID from os-release
`VERSION_ID` is more appropriate for scripts and other usages, since `VERSION` can contain spaces and codenames

from `os-release` manpage:
```
VERSION=
           A string identifying the operating system version, excluding
           any OS name information, possibly including a release code
           name, and suitable for presentation to the user. This field
           is optional.

           Examples: "VERSION=17", "VERSION="17 (Beefy Miracle)"".

 VERSION_ID=
           A lower-case string (mostly numeric, no spaces or other
           characters outside of 0–9, a–z, ".", "_" and "-") identifying
           the operating system version, excluding any OS name
           information or release code name, and suitable for processing
           by scripts or usage in generated filenames. This field is
           optional.

           Examples: "VERSION_ID=17", "VERSION_ID=11.04".
```
1 year ago
Bryce Kahle b0d976c49b
ensure host platform are files and have contents
In a containerized deployment, it is common to mount several files from /etc. Within the container, those files will be created regardless if they exist on the host or not. In those instances, the existing code would erroneously return empty platform information.
1 year ago
shirou b10acd4894 [host]: add EnableBootTimeCache function 1 year ago
Justin Yang 7ffb24dbe3
Merge branch 'shirou:master' into feature/netbsd-arm64-port 2 years ago
Justin Yang 4a46201e00 cpu && host: fix compile time errors 2 years ago
shirou 0665cafa1b chore: replace deprecated ioutil package to os and io 2 years ago
Antoine Toulme 4ed0f1436a
return err if not EOF 2 years ago
Antoine Toulme ca71a6db3c
lint 2 years ago
Antoine Toulme 4bc9e37b0f
faster file read 2 years ago
Antoine Toulme 842e4da755 apply code review 2 years ago
Antoine Toulme 177e1b1982 remove deprecation comments 2 years ago
Antoine Toulme 0cbdf257ab change to use a typed map per code review 2 years ago
Antoine Toulme 5b9212e240 move the Env key out of internal packages 2 years ago
Antoine Toulme 38b94668ea allow to pass context values to override environment variables 2 years ago
shirou 3e789a459a [common]: fix potential leak on Sleep. 2 years ago
shirou 852f455217 fix lint 2 years ago
Ville Skyttä 70a8f589c6 Detect Docker also using /.dockerenv 2 years ago
Eng Zer Jun 37894e9b28
test: use `T.Setenv` to set env vars in tests
This commit replaces `os.Setenv` with `t.Setenv` in tests. The
environment variable is automatically restored to its original value
when the test and all its subtests complete.

Reference: https://pkg.go.dev/testing#T.Setenv
Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
2 years ago
Aman Gupta Karmani 34cc43d282
[android][host] fix Info() failure due to forbidden /proc/stat and /proc/uptime (#1361)
* [android][host] fallback to sysinfo() syscall for uptime

with Android O, /proc/{stat,uptime} both return permission denied
3 years ago
shirou 769daafb9e
Merge pull request #1347 from atoulme/windows_errors
Return all Windows partitions
3 years ago
Antoine Toulme dbc0f20fe3 code review 3 years ago
shirou 16b3aac6ad
Merge pull request #1336 from johanburati/job043
Add hostinfo Virtualization hyperv
3 years ago
Ties de Wit f253d81d1b
Update common.go 3 years ago
Johan Burati e7034b47f2 Add hostinfo Virtualization hyperv 3 years ago
shirou 839e8b731f fix(common): simplify size check 3 years ago