Commit Graph

113 Commits (46c4ce3ffc9a60230e2e9ae94a77444460c9685c)

Author SHA1 Message Date
Ville Skyttä 70a8f589c6 Detect Docker also using /.dockerenv
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>
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
shirou 769daafb9e
Merge pull request #1347 from atoulme/windows_errors
Return all Windows partitions
Antoine Toulme dbc0f20fe3 code review
shirou 16b3aac6ad
Merge pull request #1336 from johanburati/job043
Add hostinfo Virtualization hyperv
Ties de Wit f253d81d1b
Update common.go
Johan Burati e7034b47f2 Add hostinfo Virtualization hyperv
shirou 839e8b731f fix(common): simplify size check
shirou 5610fbc5d5 fix(host,linux): Check if path exists and is nonempty before reading host files
shirou 80c890dc4c fix(host,linux): when platform is detected to be 'amazon' cleanup os-release ID
shirou f11e3ba120 fix(net,linux): move IsLittleEndian to internal
Ville Skyttä f7e1f36418 refactor: remove unnecessary exec.LookPath calls
Executing the command does the lookup if needed and returns the same
error when not found, no need to do it separately.
Matthieu MOREL b0469a470b
Merge branch 'master' into master
Ville Skyttä 1e56c6f421 Spelling and grammar fixes
Matthieu MOREL 8ba220d241 enable contextcheck linter
shirou b4808b3e94
Merge pull request #1204 from YangKeao/fix-unstable-boottime
fix unstable boot time because of float conversion
shirou 2f8da0a394
Merge pull request #1205 from mmorel-35/master
enable more linters, report coverage and cache mods
Makazeu 521fafd945
Fix a typo in comment
Matthieu MOREL 851bffc0f1
enable gosec linter
mmorel-35 1e6b445a8a gofumpt
shirou 69ea4bfdae
Merge pull request #1194 from mmorel-35/master
Enable errorlint and gci linters
YangKeao 1b5757b7d1 fix unstable boot time because of float conversion
Signed-off-by: YangKeao <yangkeao@chunibyo.icu>
wyl 5a288fb852 Fix bug for func named ReadLinesOffsetN
Matthieu MOREL b673968d5d
enable errorlint linter
shirou d2e27c1712 fix dependabot v2 deletion.
shirou 0969c9436b delete v2 directory, move v3 to top #1078
shirou 0fdf65fa3e Change to use yusufpapurcu/wmi from StackExchange/wmi.
shirou 0ce33dbe64
Merge pull request #1166 from easyops-cn/kestrel/process
feat(process): implement the 'OpenFilesWithContext' function of the windows system
kestrel 3dabe50107 feat(process): implement the 'OpenFilesWithContext' function of the windows system
Ville Skyttä a21240a319 Simplify some if blocks
Ville Skyttä fb0c322260 Check error identity with errors.Is
Ville Skyttä 633e77013f Use short if
Ville Skyttä ce9d35436e Merge variable declaration with assignment
Ville Skyttä 5d0724f42f Comment convention fixes
Ville Skyttä 65616500e8 Remove unnecessary empty lines
Ville Skyttä a9b1ce2dec Remove unnecessary conversions
Ville Skyttä 7743265113 Rewrite if-else chains as switches
shirou 2fa855f295 add MockEnv as more generic function.
Johannes Drummer 76fb312c4b delete unused PdhAddCounterW
Johannes Drummer 82b235c9f5 v2 windows counters on non english systems
AtakanColak 498a39984d tidy comments
AtakanColak 2c98f69e11 add load v2
tidied up common/windows
added load benchmark for load_test
cpu percent is used as load if queue is zero
AtakanColak 24e6d6d350 add load to windows
Atakan 3504ea07b0 simplify virt cache
shirou b94f262e7d
Merge pull request #949 from boogie-byte/vet-target
Add "vet" target to the Makefile
Sergey Vinogradov 8ff2ab3187 Add "vet" target to the Makefile
Making the "vet" target will run "go vet ./..." for each supported
GOOS.

Also, some of the warnings produced by go 1.15 vet were mitigated.
Ryan Fitzpatrick 8046134504
Fix VirtualizationWithContext() race in linux
shirou 5084874a4c
Merge pull request #942 from AtakanColak/patch-1
Cache common/common_linux.Virtualization()
Ata ba243b1d14
removed explicit set to nil