Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@curioswitch
Copy link
Contributor

@curioswitch curioswitch bot commented Dec 1, 2025

This PR contains the following updates:

Package Type Update Change
github.com/goyek/goyek/v2 require major v2.3.0v3.0.1

Release Notes

goyek/goyek (github.com/goyek/goyek/v2)

v3.0.1: 3.0.1

Compare Source

This patch release improves documentation.

v3.0.0: 3.0.0

Compare Source

This major release improves the command-line interface and changes the A.Context behavior to match testing.T.Context.

Migration Guide from v2 to v3
Module Path Change

Update your import statements and go.mod.

// Before (v2)
import "github.com/goyek/goyek/v2"

// After (v3)
import "github.com/goyek/goyek/v3"
Command Line Syntax Change

The recommended command line syntax changed from [flags] [--] [tasks] to
[tasks] [flags] [--] [args].

// Before (v2)
func main() {
    flag.Parse()
    goyek.Main(flag.Args())
}

// After (v3)
func main() {
    tasks, rest := goyek.SplitTasks(os.Args[1:])
    flag.CommandLine.Parse(rest)
    goyek.Main(tasks)
}
Context Behavior Change

A.Context is now canceled just before cleanup functions are called. If your cleanup functions depend on the context being active, they will continue to work. If your code depended on the context remaining active after cleanup, it will need adjustment.

// Before (v2): Context stayed active during cleanup.
goyek.Define(goyek.Task{
    Name: "example",
    Action: func(a *goyek.A) {
        a.Cleanup(func() {
            // Context was still active here.
        })
    },
})

// After (v3): Context cancels before cleanup (matches testing.T behavior).
goyek.Define(goyek.Task{
    Name: "example",
    Action: func(a *goyek.A) {
        a.Cleanup(func() {
            // Context is canceled here, allowing proper shutdown
            // of resources that listen to context.Done().
        })
    },
})
Added
  • Add SplitTasks function to split command line arguments into tasks and rest. This allows tasks to come before flags and usage of positional arguments.
Changed
  • BREAKING: Change module path to github.com/goyek/goyek/v3.
  • BREAKING: Change A.Context behavior to be canceled just before cleanup functions are called, matching testing.T.Context behavior. The context still cancels when the original context is canceled (e.g. flow interruption). This ensures cleanup functions can wait for resources that shut down on context.Context.Done before the task action completes.

Configuration

📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box

This PR has been generated by Renovate Bot.

@curioswitch curioswitch bot added the dependencies Pull requests that update a dependency file label Dec 1, 2025
@curioswitch curioswitch bot force-pushed the renovate/major-go-dependencies branch from adeafa7 to 3e65315 Compare December 15, 2025 12:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant