Skip to content

Commit d2582ed

Browse files
committed
move if to switch
1 parent 4891cbf commit d2582ed

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

cli/open.go

+2-3
Original file line numberDiff line numberDiff line change
@@ -290,11 +290,10 @@ func windowsJoinPath(elem ...string) string {
290290
// If the path is being resolved within the workspace, the path will be resolved
291291
// relative to the current working directory.
292292
func resolveAgentAbsPath(workingDirectory, relOrAbsPath, agentOS string, local bool) (string, error) {
293-
if relOrAbsPath == "" {
293+
switch {
294+
case relOrAbsPath == "":
294295
return workingDirectory, nil
295-
}
296296

297-
switch {
298297
case relOrAbsPath == "~" || strings.HasPrefix(relOrAbsPath, "~/"):
299298
return "", xerrors.Errorf("path %q requires expansion and is not supported, use an absolute path instead", relOrAbsPath)
300299

0 commit comments

Comments
 (0)