Antoine Toulme
b712e59295
fix more linting reports
2023-06-03 14:17:16 -07:00
Antoine Toulme
38b94668ea
allow to pass context values to override environment variables
2023-06-02 01:31:05 -07:00
Matthieu MOREL
1fb1e3e3e6
ci(lint): correct gci linter
...
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
2023-04-04 18:07:22 +00:00
Josh Powers
e7c6b6991d
fix: moves common.Warnings to common OS files
...
This allows all OS types to unwrap the Warnings from errors, and not
just linux in host or windows in disk.
fixes : #1429
2023-03-15 06:39:08 -06:00
Jacob Young
02660eaf7c
Update host/host_linux.go
...
Use a raw string instead of escaped quotes.
Co-authored-by: shirou <shirou.faw@gmail.com>
2023-03-10 09:41:18 -05:00
Jacob Young
43566581f0
Recognize Cumulus Linux distro
...
Add Cumulus Linux and Kylin to debian family
2023-02-24 13:59:01 -05:00
shirou
6a5e40a517
Merge pull request #1228 from abner-chenc/master
...
host: add support for linux/loong64
2023-02-12 16:48:27 +09:00
shirou
e563e6394e
Merge pull request #1356 from N1neSun/patch-1
...
fix some kylin linux bug
2023-02-12 16:46:43 +09:00
shirou
0494d7f0b9
Merge pull request #1403 from Agilicus/add-ppc64be
...
[host] linux/ppc: ppc64 definition from ppc64le
2023-02-01 07:55:42 +09:00
Guoqi Chen
b793d83f72
host: add support for linux/loong64
...
Updates #1338 .
Signed-off-by: Guoqi Chen <chenguoqi@loongson.cn>
Co-authored-by: Jiantao Shan <shanjiantao@loongson.cn>
2023-01-14 07:09:59 +08:00
Jeff Erbrecht
a5ecb9bca5
[host] windows: use millisecond precision for BootTime()
...
Previously, system uptime is truncated to seconds, and then the
subtraction from `time.Now()` is performed. Because uptime does not roll
over to the next second at the same instant as `time.Now()`, then
`BootTime()` ends up not being precise, and often varies by 1 second.
This commit does the subtraction before truncating to seconds, which
results in a significantly lower chance of variance in `BootTime()`.
2023-01-04 10:42:00 -05:00
Don Bowman
d7f1f76519
[host] linux/ppc: ppc64 definition from ppc64le
...
Same as commit fc04d2d, but for ppc64 from ppc64le definition.
2023-01-03 20:56:48 -05:00
Tobias Klauser
f9a5834e0e
host: use unix.ByteSliceToString
...
Use ByteSliceToString provided in golang.org/x/sys/unix to convert
\0-terminated byte slices to strings.
2022-12-07 13:14:45 +01:00
shirou
5473fd114d
[disk][host]: change to use type alias.
2022-11-30 23:23:31 +00:00
shirou
4ac7e99c6a
[disk][host]: move back Warnings from internal to disk and host.
...
fix #1377
2022-11-19 11:37:38 +00:00
shirou
68452e2602
feat(host, windows): add UBR (Update Build Revision) to kernel version
2022-11-05 20:59:15 +09:00
Antoine Toulme
dbc0f20fe3
code review
2022-10-03 13:55:14 -07:00
N1neSun
add9158d4e
fix some kylin linux bug
2022-09-23 16:23:47 +08:00
shirou
ed37dc27a2
Merge pull request #1335 from tklauser/drop-darwin-386
...
host, process: delete darwin/386 code
2022-07-30 11:24:12 +09:00
Stuart Caie
e0400cc94f
Use 0 as default mach port
2022-07-30 00:44:15 +00:00
Tobias Klauser
c76712b8da
host, process: delete darwin/386 code
...
The darwin/386 port was dropped in Go 1.15 and the imported version of
golang.org/x/sys also no longer supports the port. This module requires
at least Go 1.15 per go.mod, so it no longer builds on darwin/386
anyway.
2022-07-28 13:01:59 +02:00
Stuart Caie
55411f1178
Replace IOMainPort/IOMasterPort() and kIOMainPortDefault/kIOMasterPortDefault with NULL
2022-07-25 12:19:31 +00:00
shirou
5610fbc5d5
fix(host,linux): Check if path exists and is nonempty before reading host files
2022-07-15 12:25:44 +00:00
yueyt
15354cbdee
add neokylin host info on linux
2022-07-05 17:19:18 +08:00
Martin Reindl
1d89235f34
host: add support for OpenBSD/armv7
2022-04-15 21:11:36 +02:00
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.
2022-03-04 18:56:33 +02:00
Ville Skyttä
7a8feb155b
[host][solaris] implement SensorsTemperaturesWithContext
2022-02-05 23:20:11 +02:00
Lammert Hellinga
001699bed7
Let almalinux be part of the rhel family
2022-01-19 22:37:51 +01:00
Matthieu MOREL
4671e649aa
enable revive linter
2021-12-22 23:49:50 +01:00
mmorel-35
1e6b445a8a
gofumpt
2021-12-22 21:54:41 +00:00
mmorel-35
eb5f6203d8
gofmt
2021-12-22 21:46:33 +00:00
shirou
b1186a68ed
Merge pull request #1191 from shirou/feature/update_mac_cgo
...
[disk][host][mac] fix deprecated code in macOS Monterey
2021-12-22 21:54:48 +09:00
Matthieu MOREL
b673968d5d
enable errorlint linter
2021-12-04 22:29:38 +01:00
shirou
4c3edcfe56
[mac] fix deprecated code in macOS Monterey
2021-12-04 03:37:03 +00:00
shirou
d2e27c1712
fix dependabot v2 deletion.
2021-12-01 00:12:55 +00:00
shirou
0969c9436b
delete v2 directory, move v3 to top #1078
2021-11-30 23:47:59 +00:00
shirou
0fdf65fa3e
Change to use yusufpapurcu/wmi from StackExchange/wmi.
2021-11-20 11:36:30 +00:00
shirou
e032a1c81d
Merge pull request #1059 from d1ss0nanz/issue1058
...
use ioreg to read IOPlatformUUID as HostID
2021-10-30 17:43:32 +09:00
Lars Meyer
a7d936d0a4
[host][windows] Fix Windows 11 reporting
...
While ProductName remains "Windows 10", versions with Build no. >= 22000
are Windows 11.
2021-10-08 09:36:28 +02:00
odinje
a3e22baec0
Ensure rhel platform family for Rocky Linux
2021-07-21 23:04:09 +02:00
shirou
2782a109dc
Merge pull request #1010 from gdbinit/openbsd-wrong-users-number-patch
...
Fix wrong OpenBSD user count
2021-05-29 13:39:08 +09:00
Daniel Stutz
9916462c47
use ioreg to read IOPlatformUUID as HostID
2021-04-13 10:31:23 +02:00
Guillaume Ballet
992d17af94
add support for OpenBSD arm64
2021-03-23 15:29:27 +01:00
Mykola Terelia
84e8e51bf9
Added missing distributions to the suse platform family
2021-03-16 18:16:30 +02:00
fG!
ab33d5ec89
Fix wrong user count
...
There are empty entries in OpenBSD's utmp that have a line and time entry but no user logged in (the entry is "cleared" after user logs out but not totally as expected in the code here). Current checks are insufficient so check if Name field is empty and skip in that case.
2020-12-13 00:34:27 +00:00
shirou
f377a07e5a
fix test and openbsd errors.
2020-10-25 19:06:59 +09:00
Ryan Fitzpatrick
8046134504
Fix VirtualizationWithContext() race in linux
2020-10-06 17:03:49 +00:00
shirou
6c9f3bdcae
[host][linux] Change to use unix.SysInfo_t to get Uptime in Linux
2020-09-19 11:12:05 +09:00
Sergey Vinogradov
5209442b3c
Refactor "host" package
2020-09-11 18:54:53 +03:00
Lomanic
8a625ec054
[host][process][darwin] Go-fmt code from mktypes.sh from #917
2020-09-07 21:12:17 +02:00