mirror of
https://github.com/psviderski/uncloud.git
synced 2026-08-26 19:13:34 +00:00
chore: modernize the codebase using go 1.26 (#278)
This runs: ``` go run golang.org/x/tools/gopls/internal/analysis/modernize/cmd/modernize@latest -fix ./... ``` over the codebase, as this is using go 1.26, it can also use the new new() functionallity so AsPtr and boolPtr is are needed anymore. Signed-off-by: Miek Gieben <miek@miek.nl>
This commit is contained in:
+3
-6
@@ -2,6 +2,7 @@ package api
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"maps"
|
||||
"reflect"
|
||||
"slices"
|
||||
"sort"
|
||||
@@ -165,18 +166,14 @@ func (v *VolumeSpec) Clone() VolumeSpec {
|
||||
driver := *v.VolumeOptions.Driver
|
||||
if driver.Options != nil {
|
||||
driver.Options = make(map[string]string, len(v.VolumeOptions.Driver.Options))
|
||||
for k, val := range v.VolumeOptions.Driver.Options {
|
||||
driver.Options[k] = val
|
||||
}
|
||||
maps.Copy(driver.Options, v.VolumeOptions.Driver.Options)
|
||||
}
|
||||
opts.Driver = &driver
|
||||
}
|
||||
|
||||
if opts.Labels != nil {
|
||||
opts.Labels = make(map[string]string, len(v.VolumeOptions.Labels))
|
||||
for k, val := range v.VolumeOptions.Labels {
|
||||
opts.Labels[k] = val
|
||||
}
|
||||
maps.Copy(opts.Labels, v.VolumeOptions.Labels)
|
||||
}
|
||||
|
||||
spec.VolumeOptions = &opts
|
||||
|
||||
Reference in New Issue
Block a user