filepath.Join or path.Join

I am wondering what I should pick between the two:

  • filepath.Join
  • path.Join

From you experience so far, is there any big advantage using one over the other?

It depends on your use case.

path.Join will always use / to join segments, eg for URLs, filepath.Join though will use the separators of the operating system you are using, eg. \ for windows and / for linux and mac.

1 Like

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.