hexdigest / gowrap

GoWrap is a command line tool for generating decorators for Go interfaces
MIT License
1.09k stars 82 forks source link

template path in generated code uses OS specific path separators #75

Open stgraham2000 opened 1 year ago

stgraham2000 commented 1 year ago

When using file paths to specify the location of a template, the generated code will use either a "/" or a "\" to separate directories in the path. This is an issue if you checkin the generated code and you have some users that generate using a Linux system and other users that generate using a Windows system.

The expectation is that the generated code should not change based on what type of system the generation is performed on.

Propose to do a simple search/replace on the file path and replace any "\" with a "/"

Southclaws commented 5 months ago

+1 just ran into this, confused me for a while.

Windows has used / for almost two decades, the \ requirement is a bit of a misconception, almost all but maybe old DOS software uses / now so it's best to just always use / for all platforms.

Can open a PR to fix this issue as I use Windows and Mac mainly and this is a bit of an annoying bug.