Question: How can you make a file build only on Windows?

  1. Check runtime.GOOS.
  2. Add a // +build windows comment anywhere in the file.
  3. Add a \_ prefix to the file name.
  4. Add a // +build windows comment at the top of the file.

Answer: The correct answer of the above question is Option D:Add a // +build windows comment at the top of the file.