You could use Build Constraints to switch between implementations depending on the OS you build on.
lutzhorn (Lutz Horn) #21
akhilravuri (ravuri sai ram akhil) #22
Build is for files. Is there any thing for functions in the same way.
Tamas_Gulacsi (Tamás Gulácsi) #23
- 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.