vidar-team / Cardinal_frontend

Cardinal 选手端 前端
9 stars 7 forks source link

Unexpected EOF #26

Open codergu64 opened 3 years ago

codergu64 commented 3 years ago

Hey, you! I'm learning GOLANG recently. For VUE package to GO, I tried to use Go Generate & Togo here, but output ERROR. I wanna know it happens whether my env or operation wrong?

Output following:

dist.go:3: error reading dist.go: unexpected EOF

Thanks for taking up your time!

wuhan005 commented 3 years ago

Try the following commands:

# build the frontend
yarn install && yarn build
# switch into `dist` folder
cd dist
# embed static files with togo
togo http -package dist -output dist_gen.go

Then a new dist_gen.go file should be created. I am not sure what the problem is.

However, Go 1.16 provides go embed which allows you to embed static files into the target binary. Cardinal will support this feature and togo will be deprecated soon. Read this article written in Chinese to get more information about go embed.