Two fixes in our Go API code: (#5066)

* Replace `interface{}` with `any`
* For options that are bools, don't always set true; set to the actual
  value passed in (some options already behaved this way, but they all
  should)
This commit is contained in:
Jeff Mitchell authored and GitHub committed 2024-09-04 11:40:43 -04:00
1 parent 4e8e069c9c
commit 35d1df7388
72 files changed
+510 -475

No files matched your search

+4 -4
View File
@@ -21,7 +21,7 @@ import (
type Option func(*options)
type options struct {
postMap map[string]interface{}
postMap map[string]any
queryMap map[string]string
withAutomaticVersioning bool
withSkipCurlOutput bool
@@ -32,7 +32,7 @@ type options struct {
func getDefaultOptions() options {
return options{
postMap: make(map[string]interface{}),
postMap: make(map[string]any),
queryMap: make(map[string]string),
}
}
@@ -74,7 +74,7 @@ func WithAutomaticVersioning(enable bool) Option {
// Useful for when we need to look up versions.
func WithSkipCurlOutput(skip bool) Option {
return func(o *options) {
o.withSkipCurlOutput = true
o.withSkipCurlOutput = skip
}
}
@@ -99,7 +99,7 @@ func WithFilter(filter string) Option {
// resource
func WithRecursive(recurse bool) Option {
return func(o *options) {
o.withRecursive = true
o.withRecursive = recurse
}
}
+1 -1
View File
@@ -56,7 +56,7 @@ type UserDeleteResult struct {
}
// GetItem will always be nil for UserDeleteResult
func (n UserDeleteResult) GetItem() interface{} {
func (n UserDeleteResult) GetItem() any {
return nil
}