Skip to content

Commit ef089be

Browse files
committed
safe assign
1 parent 9c1bf01 commit ef089be

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

agent/agentcontainers/devcontainer.go

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,13 +64,16 @@ func devcontainerStartupScript(dc codersdk.WorkspaceAgentDevcontainer, script co
6464
}
6565

6666
func expandDevcontainerPaths(logger slog.Logger, expandPath func(string) (string, error), dc codersdk.WorkspaceAgentDevcontainer) codersdk.WorkspaceAgentDevcontainer {
67-
var err error
68-
if dc.WorkspaceFolder, err = expandPath(dc.WorkspaceFolder); err != nil {
67+
if wf, err := expandPath(dc.WorkspaceFolder); err != nil {
6968
logger.Warn(context.Background(), "expand devcontainer workspace folder failed", slog.Error(err))
69+
} else {
70+
dc.WorkspaceFolder = wf
7071
}
7172
if dc.ConfigPath != "" {
72-
if dc.ConfigPath, err = expandPath(dc.ConfigPath); err != nil {
73+
if cp, err := expandPath(dc.ConfigPath); err != nil {
7374
logger.Warn(context.Background(), "expand devcontainer config path failed", slog.Error(err))
75+
} else {
76+
dc.ConfigPath = cp
7477
}
7578
}
7679
return dc

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy