mirror of
https://github.com/containers/podman.git
synced 2025-08-24 01:50:58 +08:00
Replace strings.SplitN with strings.Cut
Cut is a cleaner & more performant api relative to SplitN(_, _, 2) added in go 1.18 Previously applied this refactoring to buildah: https://github.com/containers/buildah/pull/5239 Signed-off-by: Philip Dubé <philip@peerdb.io>
This commit is contained in:
@ -97,8 +97,8 @@ func (c *Container) Commit(ctx context.Context, destImage string, options Contai
|
||||
// Should we store the ENV we actually want in the spec separately?
|
||||
if c.config.Spec.Process != nil {
|
||||
for _, e := range c.config.Spec.Process.Env {
|
||||
splitEnv := strings.SplitN(e, "=", 2)
|
||||
importBuilder.SetEnv(splitEnv[0], splitEnv[1])
|
||||
key, val, _ := strings.Cut(e, "=")
|
||||
importBuilder.SetEnv(key, val)
|
||||
}
|
||||
}
|
||||
// Expose ports
|
||||
|
Reference in New Issue
Block a user