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
-7
@@ -73,7 +73,7 @@ type ServiceSpec struct {
|
||||
// Default is 10 seconds if not specified.
|
||||
StopGracePeriod *time.Duration `json:",omitempty"`
|
||||
// UpdateConfig configures how the service is updated during a deployment.
|
||||
UpdateConfig UpdateConfig `json:",omitempty"`
|
||||
UpdateConfig UpdateConfig
|
||||
// Volumes is list of data volumes that can be mounted into the container.
|
||||
Volumes []VolumeSpec
|
||||
}
|
||||
@@ -348,9 +348,7 @@ func (s *ContainerSpec) Clone() ContainerSpec {
|
||||
}
|
||||
if s.Env != nil {
|
||||
spec.Env = make(EnvVars, len(s.Env))
|
||||
for k, v := range s.Env {
|
||||
spec.Env[k] = v
|
||||
}
|
||||
maps.Copy(spec.Env, s.Env)
|
||||
}
|
||||
if s.Healthcheck != nil {
|
||||
hc := *s.Healthcheck
|
||||
@@ -380,9 +378,7 @@ func (s *ContainerSpec) Clone() ContainerSpec {
|
||||
}
|
||||
if s.Sysctls != nil {
|
||||
spec.Sysctls = make(map[string]string, len(s.Sysctls))
|
||||
for k, v := range s.Sysctls {
|
||||
spec.Sysctls[k] = v
|
||||
}
|
||||
maps.Copy(spec.Sysctls, s.Sysctls)
|
||||
}
|
||||
if s.Resources.Ulimits != nil {
|
||||
spec.Resources.Ulimits = maps.Clone(s.Resources.Ulimits)
|
||||
|
||||
Reference in New Issue
Block a user