Skip to content

Windows - customFlags should use filepath.Clean() instead of path.Clean() #22367

@tintinweb

Description

@tintinweb

go-ethereum/cmd/utils/customflags.go is handling OS paths and therefore it should use filepath.Clean() (works for windows path separator) instead of path.Clean() (nix path separator)

return path.Clean(os.ExpandEnv(p))

path.Clean()
https://github.com/golang/go/blob/master/src/path/path.go#L51-L62

filepath.Clean()
https://github.com/golang/go/blob/master/src/path/filepath/path.go#L66-L79

Expected behaviour

should cleanup for OS path separator

Actual behaviour

path.Clean() assumes the path separator is / while it might be \\

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions