Remix.run Logo
PhilippGille 18 hours ago

One issue is when the path is not interpreted by the shell but by a program which plays by different rules.

For example in Go:

  $ cd /path/to/go/repo
  $ go run cmd/myapp
  package cmd/myapp is not in std (/usr/local/go/src/cmd/myapp)
  
  $ go run ./cmd/myapp
  Hello, World!
And then people don't want to think about when your path is for the shell and when it's a CLI param and how the CLI treats it, and just use the version that always works.
Y_Y 17 hours ago | parent | next [-]

Thanks, this is the first good reason I've seen! Seems crazy to me that the go tool does that, but maybe I just lack sufficient unix-nature.

zahlman 17 hours ago | parent [-]

This allows it to disambiguate between system path syntax and the language's syntax for symbolic names.

Similarly, package installers can use this to disambiguate between "install the local file with this exact name" and "look up a file on the index for the named package".

catlifeonmars 12 hours ago | parent | prev | next [-]

That’s because cmd/myapp is not a local path, it’s a universal path. It makes more sense when you type go run github.com/user/name/cmd/myapp

umanwizard 13 hours ago | parent | prev [-]

This is one of the papercuts of go that I find way more annoying than is rational.