You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit a97f9fd
Browse filesBrowse the repository at this point in the historyBrowse files
The new type CompletionFunc could lead to a regression.
This commit make the new `CompletionFunc` type a type alias instead,
in case projects using Cobra have created their own similar type.
This commit also adds a test to ensure that the completion function
remains backwards-compatible.
Signed-off-by: ccoVeille <[email protected]>
// Here we are validating the existing type validates the CompletionFunc type
2952
+
var_CompletionFunc=userComp
2953
+
2954
+
cmd:=Command{
2955
+
ValidArgsFunction: userComp,
2956
+
}
2957
+
2958
+
_=cmd.RegisterFlagCompletionFunc("foo", userComp)
2959
+
})
2960
+
2961
+
t.Run("type alias helper", func(t*testing.T) {
2962
+
// This is a type that may have been defined by the user of the library
2963
+
// This replicates the possible fix that was tried here https://github.com/docker/cli/pull/5828
0 commit comments