You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When running in Linux and running the compiled app in Linux everyting works just fine :)
When i try to compile for windows it works but when i start the application I get file not found. 2024/01/21 01:09:12 html/template: "index.html" is undefined
for GOOS in darwin linux windows; do
for GOARCH in 386 amd64; do
export GOOS GOARCH
if [ $GOOS = windows ]
then
# if-code
go build -v -o ./dist/$myapp-$GOOS-$GOARCH.exe
elif [ "${GOOS}-${GOARCH}" != "darwin-386" ]
then
go build -v -o ./dist/$myapp-$GOOS-$GOARCH
fi
done
done`
I got a folder named templates and in the main.go i set up the reference to embed like so:
//go:embed all:templates/* templateFS embed.FS
I have tried some variants on just embed, but I don't get it to work.
Is it something known or is it just me?
The text was updated successfully, but these errors were encountered:
I am also on Windows, and encountered the same problem while trying to use the Go HTMX Tailwind Example
I logged out the paths being passed to the WalkDirFunc and found they were all being separated by a / despite being on windows (not sure if that's caused by fs or embed or something else entirely).
But in any case, replacing String(os.PathSeparator) with "/" did the trick for me.
Hi there. So sorry that I missed this issue earlier. I tried to write TemplateParseFSRecursive so that it would be cross-platform. Unfortunately I don't have a Windows machine to test it. I'm open to a pull request if you can verify that it works xplat. Thanks!
When running in Linux and running the compiled app in Linux everyting works just fine :)
When i try to compile for windows it works but when i start the application I get file not found.
2024/01/21 01:09:12 html/template: "index.html" is undefined
Here is how i Crosscompile :
`#!/usr/bin/env zsh
myapp="webapp"
echo -n "Enter appname: "
read myapp
for GOOS in darwin linux windows; do
for GOARCH in 386 amd64; do
export GOOS GOARCH
if [ $GOOS = windows ]
then
# if-code
go build -v -o ./dist/$myapp-$GOOS-$GOARCH.exe
elif [ "${GOOS}-${GOARCH}" != "darwin-386" ]
then
go build -v -o ./dist/$myapp-$GOOS-$GOARCH
fi
done
done`
I got a folder named templates and in the main.go i set up the reference to embed like so:
//go:embed all:templates/* templateFS embed.FS
I have tried some variants on just embed, but I don't get it to work.
Is it something known or is it just me?
The text was updated successfully, but these errors were encountered: