Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

5
  • The directory with the templates is located in the same directory the binary is outputted to. The path indicates where in the directory is the template dir Commented May 21, 2025 at 12:15
  • 1
    A relative path is relative to your current working directory, not the location of the binary you are calling. Commented May 21, 2025 at 12:19
  • Do you have a reliable solution to fix this issue? Commented May 21, 2025 at 12:26
  • You can do any of the same things for any application that needs to locate files. Check well-known locations, pass in a path at runtime via configuration, flags or environment variables, check things relative to the executable path and so on. Commented May 21, 2025 at 12:29
  • 2
    You can also directly embed the files in your binary using the embed package Commented May 21, 2025 at 12:37