Skip to content

v0.7.5

Choose a tag to compare

@snonux snonux released this 17 Sep 05:38
· 522 commits to main since this release

Release v0.7.5

gonf Release Notes

This release adds a small quality-of-life improvement to the task registration API, making it a little easier to write companion methods that attach per-task options.

Improvements

TaskOptions alias for concise signatures

A new named type, TaskOptions, has been introduced as an alias for []TaskOption. Because it is a true alias rather than a new type, it is fully interchangeable with []TaskOption everywhere — no existing code breaks and nothing else needs to change.

The motivation is readability. If you use RegisterMethods with the OptsX() companion convention (for example, to mark a specific task as Privileged() or gate it with a serializable predicate like WhenHostnameContains()), the signature now reads more naturally:

// Before
func (Home) OptsPkgOpenBSD() []TaskOption { return []TaskOption{Privileged()} }

// After
func (Home) OptsPkgOpenBSD() TaskOptions { return TaskOptions{Privileged()} }

The RegisterMethods signature check, the panic message for a mis-declared companion, and the documentation all use the new alias name consistently.

Migration steps: None required. Both []TaskOption and TaskOptions remain valid in OptsX() companion methods, so you can adopt the alias incrementally (or not at all) at your convenience.

Housekeeping

  • Version bumped to 0.7.5.
  • Documentation in docs/tasks.md updated to reflect the new alias and note that either form works.