You could use Build Constraints to switch between implementations depending on the OS you build on.
Build is for files. Is there any thing for functions in the same way.
- Create two files: db_windows.go and db_posix.go
- Then write the same functions in both files, differentiate only as the platforms need.
- profit. Only db_windows.go will be compiled on Windows and db_posix.go on Linux.
This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.