diff options
author | Ben Kochie <superq@gmail.com> | 2020-05-25 14:03:04 +0200 |
---|---|---|
committer | Ben Kochie <superq@gmail.com> | 2020-05-25 14:03:04 +0200 |
commit | 11a0aaaa0a0e19d56c5054d9b825465e08e1dfca (patch) | |
tree | 3710411fa6aa465c93f0e53dd05a1454d9ea0a83 | |
parent | 2aef188bc819bade18ec297f9ce34f200caf1431 (diff) | |
download | prometheus_node_collector-11a0aaaa0a0e19d56c5054d9b825465e08e1dfca.tar.bz2 prometheus_node_collector-11a0aaaa0a0e19d56c5054d9b825465e08e1dfca.tar.xz prometheus_node_collector-11a0aaaa0a0e19d56c5054d9b825465e08e1dfca.zip |
Release 1.0.0
* The netdev collector CLI argument `--collector.netdev.ignored-devices` was renamed to `--collector.netdev.device-blacklist` in order to conform with the systemd collector. #1279
* The label named `state` on `node_systemd_service_restart_total` metrics was changed to `name` to better describe the metric. #1393
* Refactoring of the mdadm collector changes several metrics
- `node_md_disks_active` is removed
- `node_md_disks` now has a `state` label for "fail", "spare", "active" disks.
- `node_md_is_active` is replaced by `node_md_state` with a state set of "active", "inactive", "recovering", "resync".
* Additional label `mountaddr` added to NFS device metrics to distinguish mounts from the same URL, but different IP addresses. #1417
* Metrics node_cpu_scaling_frequency_min_hrts and node_cpu_scaling_frequency_max_hrts of the cpufreq collector were renamed to node_cpu_scaling_frequency_min_hertz and node_cpu_scaling_frequency_max_hertz. #1510
* Collectors that are enabled, but are unable to find data to collect, now return 0 for `node_scrape_collector_success`.
* [CHANGE] Add `--collector.netdev.device-whitelist`. #1279
* [CHANGE] Ignore iso9600 filesystem on Linux #1355
* [CHANGE] Refactor mdadm collector #1403
* [CHANGE] Add `mountaddr` label to NFS metrics. #1417
* [CHANGE] Don't count empty collectors as success. #1613
* [FEATURE] New flag to disable default collectors #1276
* [FEATURE] Add experimental TLS support #1277, #1687, #1695
* [FEATURE] Add collector for Power Supply Class #1280
* [FEATURE] Add new schedstat collector #1389
* [FEATURE] Add FreeBSD zfs support #1394
* [FEATURE] Add uname support for Darwin and OpenBSD #1433
* [FEATURE] Add new metric node_cpu_info #1489
* [FEATURE] Add new thermal_zone collector #1425
* [FEATURE] Add new cooling_device metrics to thermal zone collector #1445
* [FEATURE] Add swap usage on darwin #1508
* [FEATURE] Add Btrfs collector #1512
* [FEATURE] Add RAPL collector #1523
* [FEATURE] Add new softnet collector #1576
* [FEATURE] Add new udp_queues collector #1503
* [FEATURE] Add basic authentication #1673
* [ENHANCEMENT] Log pid when there is a problem reading the process stats #1341
* [ENHANCEMENT] Collect InfiniBand port state and physical state #1357
* [ENHANCEMENT] Include additional XFS runtime statistics. #1423
* [ENHANCEMENT] Report non-fatal collection errors in the exporter metric. #1439
* [ENHANCEMENT] Expose IPVS firewall mark as a label #1455
* [ENHANCEMENT] Add check for systemd version before attempting to query certain metrics. #1413
* [ENHANCEMENT] Add a flag to adjust mount timeout #1486
* [ENHANCEMENT] Add new counters for flush requests in Linux 5.5 #1548
* [ENHANCEMENT] Add metrics and tests for UDP receive and send buffer errors #1534
* [ENHANCEMENT] The sockstat collector now exposes IPv6 statistics in addition to the existing IPv4 support. #1552
* [ENHANCEMENT] Add infiniband info metric #1563
* [ENHANCEMENT] Add unix socket support for supervisord collector #1592
* [ENHANCEMENT] Implement loadavg on all BSDs without cgo #1584
* [ENHANCEMENT] Add model_name and stepping to node_cpu_info metric #1617
* [ENHANCEMENT] Add `--collector.perf.cpus` to allow setting the CPU list for perf stats. #1561
* [ENHANCEMENT] Add metrics for IO errors and retires on Darwin. #1636
* [ENHANCEMENT] Add perf tracepoint collection flag #1664
* [ENHANCEMENT] ZFS: read contents of objset file #1632
* [ENHANCEMENT] Linux CPU: Cache CPU metrics to make them monotonically increasing #1711
* [BUGFIX] Read /proc/net files with a single read syscall #1380
* [BUGFIX] Renamed label `state` to `name` on `node_systemd_service_restart_total`. #1393
* [BUGFIX] Fix netdev nil reference on Darwin #1414
* [BUGFIX] Strip path.rootfs from mountpoint labels #1421
* [BUGFIX] Fix seconds reported by schedstat #1426
* [BUGFIX] Fix empty string in path.rootfs #1464
* [BUGFIX] Fix typo in cpufreq metric names #1510
* [BUGFIX] Read /proc/stat in one syscall #1538
* [BUGFIX] Fix OpenBSD cache memory information #1542
* [BUGFIX] Refactor textfile collector to avoid looping defer #1549
* [BUGFIX] Fix network speed math #1580
* [BUGFIX] collector/systemd: use regexp to extract systemd version #1647
* [BUGFIX] Fix initialization in perf collector when using multiple CPUs #1665
* [BUGFIX] Fix accidentally empty lines in meminfo_linux #1671
Signed-off-by: Ben Kochie <superq@gmail.com>
-rw-r--r-- | CHANGELOG.md | 5 | ||||
-rw-r--r-- | Makefile.common | 31 | ||||
-rw-r--r-- | VERSION | 2 | ||||
-rw-r--r-- | go.mod | 2 | ||||
-rw-r--r-- | go.sum | 4 | ||||
-rw-r--r-- | vendor/golang.org/x/sys/windows/env_windows.go | 11 | ||||
-rw-r--r-- | vendor/golang.org/x/sys/windows/security_windows.go | 20 | ||||
-rw-r--r-- | vendor/golang.org/x/sys/windows/syscall_windows.go | 30 | ||||
-rw-r--r-- | vendor/modules.txt | 2 |
9 files changed, 81 insertions, 26 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index 9e05d0f..7f32b94 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md | |||
@@ -3,9 +3,9 @@ | |||
3 | * [CHANGE] | 3 | * [CHANGE] |
4 | * [FEATURE] | 4 | * [FEATURE] |
5 | * [ENHANCEMENT] | 5 | * [ENHANCEMENT] |
6 | * [BUGFIX] Linux CPU: Cache CPU metrics to make them monotonically increasing #1711 | 6 | * [BUGFIX] |
7 | 7 | ||
8 | ## 1.0.0-rc.1 / 2020-05-14 | 8 | ## 1.0.0 / 2020-05-25 |
9 | 9 | ||
10 | ### **Breaking changes** | 10 | ### **Breaking changes** |
11 | 11 | ||
@@ -59,6 +59,7 @@ | |||
59 | * [ENHANCEMENT] Add metrics for IO errors and retires on Darwin. #1636 | 59 | * [ENHANCEMENT] Add metrics for IO errors and retires on Darwin. #1636 |
60 | * [ENHANCEMENT] Add perf tracepoint collection flag #1664 | 60 | * [ENHANCEMENT] Add perf tracepoint collection flag #1664 |
61 | * [ENHANCEMENT] ZFS: read contents of objset file #1632 | 61 | * [ENHANCEMENT] ZFS: read contents of objset file #1632 |
62 | * [ENHANCEMENT] Linux CPU: Cache CPU metrics to make them monotonically increasing #1711 | ||
62 | * [BUGFIX] Read /proc/net files with a single read syscall #1380 | 63 | * [BUGFIX] Read /proc/net files with a single read syscall #1380 |
63 | * [BUGFIX] Renamed label `state` to `name` on `node_systemd_service_restart_total`. #1393 | 64 | * [BUGFIX] Renamed label `state` to `name` on `node_systemd_service_restart_total`. #1393 |
64 | * [BUGFIX] Fix netdev nil reference on Darwin #1414 | 65 | * [BUGFIX] Fix netdev nil reference on Darwin #1414 |
diff --git a/Makefile.common b/Makefile.common index 066866e..9320176 100644 --- a/Makefile.common +++ b/Makefile.common | |||
@@ -69,6 +69,15 @@ else | |||
69 | GO_BUILD_PLATFORM ?= $(GOHOSTOS)-$(GOHOSTARCH) | 69 | GO_BUILD_PLATFORM ?= $(GOHOSTOS)-$(GOHOSTARCH) |
70 | endif | 70 | endif |
71 | 71 | ||
72 | GOTEST := $(GO) test | ||
73 | GOTEST_DIR := | ||
74 | ifneq ($(CIRCLE_JOB),) | ||
75 | ifneq ($(shell which gotestsum),) | ||
76 | GOTEST_DIR := test-results | ||
77 | GOTEST := gotestsum --junitfile $(GOTEST_DIR)/unit-tests.xml -- | ||
78 | endif | ||
79 | endif | ||
80 | |||
72 | PROMU_VERSION ?= 0.5.0 | 81 | PROMU_VERSION ?= 0.5.0 |
73 | PROMU_URL := https://github.com/prometheus/promu/releases/download/v$(PROMU_VERSION)/promu-$(PROMU_VERSION).$(GO_BUILD_PLATFORM).tar.gz | 82 | PROMU_URL := https://github.com/prometheus/promu/releases/download/v$(PROMU_VERSION)/promu-$(PROMU_VERSION).$(GO_BUILD_PLATFORM).tar.gz |
74 | 83 | ||
@@ -141,15 +150,29 @@ else | |||
141 | $(GO) get $(GOOPTS) -t ./... | 150 | $(GO) get $(GOOPTS) -t ./... |
142 | endif | 151 | endif |
143 | 152 | ||
153 | .PHONY: update-go-deps | ||
154 | update-go-deps: | ||
155 | @echo ">> updating Go dependencies" | ||
156 | @for m in $$($(GO) list -mod=readonly -m -f '{{ if and (not .Indirect) (not .Main)}}{{.Path}}{{end}}' all); do \ | ||
157 | $(GO) get $$m; \ | ||
158 | done | ||
159 | GO111MODULE=$(GO111MODULE) $(GO) mod tidy | ||
160 | ifneq (,$(wildcard vendor)) | ||
161 | GO111MODULE=$(GO111MODULE) $(GO) mod vendor | ||
162 | endif | ||
163 | |||
144 | .PHONY: common-test-short | 164 | .PHONY: common-test-short |
145 | common-test-short: | 165 | common-test-short: $(GOTEST_DIR) |
146 | @echo ">> running short tests" | 166 | @echo ">> running short tests" |
147 | GO111MODULE=$(GO111MODULE) $(GO) test -short $(GOOPTS) $(pkgs) | 167 | GO111MODULE=$(GO111MODULE) $(GOTEST) -short $(GOOPTS) $(pkgs) |
148 | 168 | ||
149 | .PHONY: common-test | 169 | .PHONY: common-test |
150 | common-test: | 170 | common-test: $(GOTEST_DIR) |
151 | @echo ">> running all tests" | 171 | @echo ">> running all tests" |
152 | GO111MODULE=$(GO111MODULE) $(GO) test $(test-flags) $(GOOPTS) $(pkgs) | 172 | GO111MODULE=$(GO111MODULE) $(GOTEST) $(test-flags) $(GOOPTS) $(pkgs) |
173 | |||
174 | $(GOTEST_DIR): | ||
175 | @mkdir -p $@ | ||
153 | 176 | ||
154 | .PHONY: common-format | 177 | .PHONY: common-format |
155 | common-format: | 178 | common-format: |
@@ -1 +1 @@ | |||
1.0.0-rc.1 | 1.0.0 | ||
@@ -28,7 +28,7 @@ require ( | |||
28 | golang.org/x/lint v0.0.0-20200302205851-738671d3881b // indirect | 28 | golang.org/x/lint v0.0.0-20200302205851-738671d3881b // indirect |
29 | golang.org/x/net v0.0.0-20200513185701-a91f0712d120 // indirect | 29 | golang.org/x/net v0.0.0-20200513185701-a91f0712d120 // indirect |
30 | golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a // indirect | 30 | golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a // indirect |
31 | golang.org/x/sys v0.0.0-20200513112337-417ce2331b5c | 31 | golang.org/x/sys v0.0.0-20200523222454-059865788121 |
32 | golang.org/x/tools v0.0.0-20200513201620-d5fe73897c97 // indirect | 32 | golang.org/x/tools v0.0.0-20200513201620-d5fe73897c97 // indirect |
33 | gopkg.in/alecthomas/kingpin.v2 v2.2.6 | 33 | gopkg.in/alecthomas/kingpin.v2 v2.2.6 |
34 | gopkg.in/yaml.v2 v2.3.0 | 34 | gopkg.in/yaml.v2 v2.3.0 |
@@ -432,8 +432,8 @@ golang.org/x/sys v0.0.0-20200106162015-b016eb3dc98e/go.mod h1:h1NjWce9XRLGQEsW7w | |||
432 | golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= | 432 | golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= |
433 | golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= | 433 | golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= |
434 | golang.org/x/sys v0.0.0-20200420163511-1957bb5e6d1f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= | 434 | golang.org/x/sys v0.0.0-20200420163511-1957bb5e6d1f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= |
435 | golang.org/x/sys v0.0.0-20200513112337-417ce2331b5c h1:kISX68E8gSkNYAFRFiDU8rl5RIn1sJYKYb/r2vMLDrU= | 435 | golang.org/x/sys v0.0.0-20200523222454-059865788121 h1:rITEj+UZHYC927n8GT97eC3zrpzXdb/voyeOuVKS46o= |
436 | golang.org/x/sys v0.0.0-20200513112337-417ce2331b5c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= | 436 | golang.org/x/sys v0.0.0-20200523222454-059865788121/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= |
437 | golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= | 437 | golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= |
438 | golang.org/x/text v0.3.2 h1:tW2bmiBqwgJj/UpqtC8EpXEZVYOwU0yG4iWbprSVAcs= | 438 | golang.org/x/text v0.3.2 h1:tW2bmiBqwgJj/UpqtC8EpXEZVYOwU0yG4iWbprSVAcs= |
439 | golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= | 439 | golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= |
diff --git a/vendor/golang.org/x/sys/windows/env_windows.go b/vendor/golang.org/x/sys/windows/env_windows.go index f482a9f..92ac05f 100644 --- a/vendor/golang.org/x/sys/windows/env_windows.go +++ b/vendor/golang.org/x/sys/windows/env_windows.go | |||
@@ -8,7 +8,6 @@ package windows | |||
8 | 8 | ||
9 | import ( | 9 | import ( |
10 | "syscall" | 10 | "syscall" |
11 | "unicode/utf16" | ||
12 | "unsafe" | 11 | "unsafe" |
13 | ) | 12 | ) |
14 | 13 | ||
@@ -40,17 +39,11 @@ func (token Token) Environ(inheritExisting bool) (env []string, err error) { | |||
40 | defer DestroyEnvironmentBlock(block) | 39 | defer DestroyEnvironmentBlock(block) |
41 | blockp := uintptr(unsafe.Pointer(block)) | 40 | blockp := uintptr(unsafe.Pointer(block)) |
42 | for { | 41 | for { |
43 | entry := (*[(1 << 30) - 1]uint16)(unsafe.Pointer(blockp))[:] | 42 | entry := UTF16PtrToString((*uint16)(unsafe.Pointer(blockp))) |
44 | for i, v := range entry { | ||
45 | if v == 0 { | ||
46 | entry = entry[:i] | ||
47 | break | ||
48 | } | ||
49 | } | ||
50 | if len(entry) == 0 { | 43 | if len(entry) == 0 { |
51 | break | 44 | break |
52 | } | 45 | } |
53 | env = append(env, string(utf16.Decode(entry))) | 46 | env = append(env, entry) |
54 | blockp += 2 * (uintptr(len(entry)) + 1) | 47 | blockp += 2 * (uintptr(len(entry)) + 1) |
55 | } | 48 | } |
56 | return env, nil | 49 | return env, nil |
diff --git a/vendor/golang.org/x/sys/windows/security_windows.go b/vendor/golang.org/x/sys/windows/security_windows.go index 4b6eff1..9e3c44a 100644 --- a/vendor/golang.org/x/sys/windows/security_windows.go +++ b/vendor/golang.org/x/sys/windows/security_windows.go | |||
@@ -7,6 +7,8 @@ package windows | |||
7 | import ( | 7 | import ( |
8 | "syscall" | 8 | "syscall" |
9 | "unsafe" | 9 | "unsafe" |
10 | |||
11 | "golang.org/x/sys/internal/unsafeheader" | ||
10 | ) | 12 | ) |
11 | 13 | ||
12 | const ( | 14 | const ( |
@@ -1229,7 +1231,7 @@ func (sd *SECURITY_DESCRIPTOR) String() string { | |||
1229 | return "" | 1231 | return "" |
1230 | } | 1232 | } |
1231 | defer LocalFree(Handle(unsafe.Pointer(sddl))) | 1233 | defer LocalFree(Handle(unsafe.Pointer(sddl))) |
1232 | return UTF16ToString((*[(1 << 30) - 1]uint16)(unsafe.Pointer(sddl))[:]) | 1234 | return UTF16PtrToString(sddl) |
1233 | } | 1235 | } |
1234 | 1236 | ||
1235 | // ToAbsolute converts a self-relative security descriptor into an absolute one. | 1237 | // ToAbsolute converts a self-relative security descriptor into an absolute one. |
@@ -1307,9 +1309,17 @@ func (absoluteSD *SECURITY_DESCRIPTOR) ToSelfRelative() (selfRelativeSD *SECURIT | |||
1307 | } | 1309 | } |
1308 | 1310 | ||
1309 | func (selfRelativeSD *SECURITY_DESCRIPTOR) copySelfRelativeSecurityDescriptor() *SECURITY_DESCRIPTOR { | 1311 | func (selfRelativeSD *SECURITY_DESCRIPTOR) copySelfRelativeSecurityDescriptor() *SECURITY_DESCRIPTOR { |
1310 | sdBytes := make([]byte, selfRelativeSD.Length()) | 1312 | sdLen := (int)(selfRelativeSD.Length()) |
1311 | copy(sdBytes, (*[(1 << 31) - 1]byte)(unsafe.Pointer(selfRelativeSD))[:len(sdBytes)]) | 1313 | |
1312 | return (*SECURITY_DESCRIPTOR)(unsafe.Pointer(&sdBytes[0])) | 1314 | var src []byte |
1315 | h := (*unsafeheader.Slice)(unsafe.Pointer(&src)) | ||
1316 | h.Data = unsafe.Pointer(selfRelativeSD) | ||
1317 | h.Len = sdLen | ||
1318 | h.Cap = sdLen | ||
1319 | |||
1320 | dst := make([]byte, sdLen) | ||
1321 | copy(dst, src) | ||
1322 | return (*SECURITY_DESCRIPTOR)(unsafe.Pointer(&dst[0])) | ||
1313 | } | 1323 | } |
1314 | 1324 | ||
1315 | // SecurityDescriptorFromString converts an SDDL string describing a security descriptor into a | 1325 | // SecurityDescriptorFromString converts an SDDL string describing a security descriptor into a |
@@ -1391,6 +1401,6 @@ func ACLFromEntries(explicitEntries []EXPLICIT_ACCESS, mergedACL *ACL) (acl *ACL | |||
1391 | } | 1401 | } |
1392 | defer LocalFree(Handle(unsafe.Pointer(winHeapACL))) | 1402 | defer LocalFree(Handle(unsafe.Pointer(winHeapACL))) |
1393 | aclBytes := make([]byte, winHeapACL.aclSize) | 1403 | aclBytes := make([]byte, winHeapACL.aclSize) |
1394 | copy(aclBytes, (*[(1 << 31) - 1]byte)(unsafe.Pointer(winHeapACL))[:len(aclBytes)]) | 1404 | copy(aclBytes, (*[(1 << 31) - 1]byte)(unsafe.Pointer(winHeapACL))[:len(aclBytes):len(aclBytes)]) |
1395 | return (*ACL)(unsafe.Pointer(&aclBytes[0])), nil | 1405 | return (*ACL)(unsafe.Pointer(&aclBytes[0])), nil |
1396 | } | 1406 | } |
diff --git a/vendor/golang.org/x/sys/windows/syscall_windows.go b/vendor/golang.org/x/sys/windows/syscall_windows.go index b3e5503..12c0544 100644 --- a/vendor/golang.org/x/sys/windows/syscall_windows.go +++ b/vendor/golang.org/x/sys/windows/syscall_windows.go | |||
@@ -13,6 +13,8 @@ import ( | |||
13 | "time" | 13 | "time" |
14 | "unicode/utf16" | 14 | "unicode/utf16" |
15 | "unsafe" | 15 | "unsafe" |
16 | |||
17 | "golang.org/x/sys/internal/unsafeheader" | ||
16 | ) | 18 | ) |
17 | 19 | ||
18 | type Handle uintptr | 20 | type Handle uintptr |
@@ -117,6 +119,32 @@ func UTF16PtrFromString(s string) (*uint16, error) { | |||
117 | return &a[0], nil | 119 | return &a[0], nil |
118 | } | 120 | } |
119 | 121 | ||
122 | // UTF16PtrToString takes a pointer to a UTF-16 sequence and returns the corresponding UTF-8 encoded string. | ||
123 | // If the pointer is nil, this returns the empty string. This assumes that the UTF-16 sequence is terminated | ||
124 | // at a zero word; if the zero word is not present, the program may crash. | ||
125 | func UTF16PtrToString(p *uint16) string { | ||
126 | if p == nil { | ||
127 | return "" | ||
128 | } | ||
129 | if *p == 0 { | ||
130 | return "" | ||
131 | } | ||
132 | |||
133 | // Find NUL terminator. | ||
134 | n := 0 | ||
135 | for ptr := unsafe.Pointer(p); *(*uint16)(ptr) != 0; n++ { | ||
136 | ptr = unsafe.Pointer(uintptr(ptr) + unsafe.Sizeof(*p)) | ||
137 | } | ||
138 | |||
139 | var s []uint16 | ||
140 | h := (*unsafeheader.Slice)(unsafe.Pointer(&s)) | ||
141 | h.Data = unsafe.Pointer(p) | ||
142 | h.Len = n | ||
143 | h.Cap = n | ||
144 | |||
145 | return string(utf16.Decode(s)) | ||
146 | } | ||
147 | |||
120 | func Getpagesize() int { return 4096 } | 148 | func Getpagesize() int { return 4096 } |
121 | 149 | ||
122 | // NewCallback converts a Go function to a function pointer conforming to the stdcall calling convention. | 150 | // NewCallback converts a Go function to a function pointer conforming to the stdcall calling convention. |
@@ -1383,7 +1411,7 @@ func (t Token) KnownFolderPath(folderID *KNOWNFOLDERID, flags uint32) (string, e | |||
1383 | return "", err | 1411 | return "", err |
1384 | } | 1412 | } |
1385 | defer CoTaskMemFree(unsafe.Pointer(p)) | 1413 | defer CoTaskMemFree(unsafe.Pointer(p)) |
1386 | return UTF16ToString((*[(1 << 30) - 1]uint16)(unsafe.Pointer(p))[:]), nil | 1414 | return UTF16PtrToString(p), nil |
1387 | } | 1415 | } |
1388 | 1416 | ||
1389 | // RtlGetVersion returns the version of the underlying operating system, ignoring | 1417 | // RtlGetVersion returns the version of the underlying operating system, ignoring |
diff --git a/vendor/modules.txt b/vendor/modules.txt index 3af82f3..50c44d6 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt | |||
@@ -123,7 +123,7 @@ golang.org/x/net/trace | |||
123 | # golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a | 123 | # golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a |
124 | ## explicit | 124 | ## explicit |
125 | golang.org/x/sync/errgroup | 125 | golang.org/x/sync/errgroup |
126 | # golang.org/x/sys v0.0.0-20200513112337-417ce2331b5c | 126 | # golang.org/x/sys v0.0.0-20200523222454-059865788121 |
127 | ## explicit | 127 | ## explicit |
128 | golang.org/x/sys/internal/unsafeheader | 128 | golang.org/x/sys/internal/unsafeheader |
129 | golang.org/x/sys/unix | 129 | golang.org/x/sys/unix |