feat: bump to Go 1.27.1, concurrent collection on all platforms, hardened executor - #15
Merged
Merged
Conversation
…ened executor Toolchain - go.mod: go 1.27.1; docs, CONTRIBUTING and copilot-instructions say Go 1.27+. - macOS installer and README state macOS 13 Ventura as the minimum, which is what Go 1.27 supports. - Adopt Go 1.27 stdlib: uuid package for UUID validation, errors.AsType in tests and docs, strings.Cut/CutPrefix, sync.WaitGroup.Go. - go fix / modernize / betteralign clean on darwin, linux and windows. Library - New shared collector (collect.go): every platform collects components concurrently, folds results in declaration order, and labels goroutines with runtime/pprof so hangs show the component in tracebacks. The duplicated Windows result-folding code is gone. - executor: CommandError wraps context.DeadlineExceeded/Canceled when the context ended the command, cmd.WaitDelay bounds pipe waits after a kill, CommandError.Stderr carries the first stderr line, and a per-call memo executor lets macOS run system_profiler SPHardwareDataType once instead of three times. - windows: probe for wmic once (removed on Windows 11 24H2 / Server 2025) and go straight to PowerShell when absent; PowerShell always runs with -NoProfile -NonInteractive. - uuid.go: reject malformed, nil and max UUIDs on all platforms; raw strings are still hashed, so well-formed UUIDs produce the same ID. - Provider: Diagnostics returns a copy, WithExecutor(nil) is ignored, an already-cancelled context is refused before collecting, hashIdentifiers no longer mutates its input. CLI - Ctrl-C / SIGTERM cancel in-flight hardware queries via signal.NotifyContext. - Package doc comment; local flag var renamed to avoid shadowing the new stdlib uuid package. Docs and repo - README rewritten: fixed the badge that pointed at a non-existent main.yml workflow, removed Windows download instructions for binaries that are not published, added an ID-stability table, emoji headers. - doc.go rewritten for the new behavior. - Workflow actions bumped to current majors; dependabot.yml now also covers github-actions. - Remove the stale 4 MB machineid binary that was tracked at the repo root despite the .gitignore rule. - .golangci.yaml: drop spf13 errcheck excludes (no such deps), exclude errors.AsType (errcheck misreads its T result). IDs are unchanged: a side-by-side run of the previous commit and this tree produced identical IDs for the default, -all, -vm, salted, MAC-all and -disk flag sets on macOS. CLI -all wall time dropped from 0.35s to 0.20s on an M-series MacBook. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
… fixture The placeholder "real-uuid" is rejected by the stricter isValidUUID, which now requires a parseable UUID. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This was referenced Sep 19, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Bumps the module to Go 1.27.1 and adopts what the release offers, fixes the issues found in a full code review, and refreshes the docs, README, CI action pins and Dependabot config. Prepares v0.2.0.
Generated IDs do not change. A side-by-side run of a build from
mainand this branch produced identical IDs for the default,-all,-vm, salted, MAC-all and-diskflag sets. CLI-allwall time dropped from 0.35s to 0.20s on macOS.Toolchain and Go 1.27
go 1.27.1ingo.mod; CONTRIBUTING, README and copilot-instructions say Go 1.27+.uuidpackage for UUID validation,errors.AsTypethroughout tests and docs,strings.Cut/CutPrefix,sync.WaitGroup.Go, goroutine pprof labels (shown in tracebacks since 1.27), and agoroutineleakprofile based test.go fix, the modernize analyzer and betteralign are clean for darwin, linux and windows. Tests also pass withGOEXPERIMENT=nojsonv2(json v1 parity).Library
collect.go). All three platforms collect components in parallel, results are folded in declaration order so IDs and diagnostics are deterministic, and the duplicated Windows result-folding code is gone.CommandErrorwrapscontext.DeadlineExceeded/context.Canceledwhen the context ended the command,cmd.WaitDelaybounds pipe waits after a kill,CommandError.Stderrcarries the first stderr line, and a per-call memo executor lets macOS runsystem_profiler SPHardwareDataTypeonce instead of three times.-NoProfile -NonInteractive.uuidpackage: malformed, nil and max UUIDs fall through to the next source. Raw strings are still hashed.Diagnostics()returns a copy,WithExecutor(nil)is ignored, an already-cancelled context is refused before collecting,hashIdentifiersno longer mutates its input.CLI
uuidflag variable is renamed so it cannot shadow the new stdlib package.Docs, CI, repo
actions/workflows/main.yml, which does not exist; badges now referencepr.yml,release.ymlandcodeql.yml. Removed the Windows download instructions since no Windows binaries are published. Added a "what changes an ID" table.doc.gorewritten for the new behavior.dependabot.ymlnow also coversgithub-actions, grouped weekly.machineidbinary that was tracked at the repo root despite the.gitignorerule.Open question for the reviewer
Four stability findings were not implemented because they rotate existing IDs on affected machines (this is a licensing library): Linux CPU
flagsline changes on kernel/microcode updates, ARM/proc/cpuinfofields are not parsed, the virtual-interface list misses Hyper-V/WSL/awdl names, and removable disks count underWithDisk(). They are disclosed in the README stability table. Say the word and they ship together in a follow-up with a migration note.Verification
go test -race.go vetandgo test -ccompile; the suites run for the first time in this PR's CI.🤖 Generated with Claude Code