mxschmitt / golang-url-shortener

URL Shortener written in Golang using Bolt DB or Redis. Provides features such as Deletion, Expiration, OAuth and is of course Dockerizable.
https://so.sh0rt.cat
MIT License
283 stars 84 forks source link

can't compile #127

Closed miekg closed 5 years ago

miekg commented 5 years ago

Hi, thanks for this package

I have trouble compiling, because there are no Go files in internal/handlers/tmpls - there is just these 2 html files. but the code using tmpls uses FFSstring which obvs isn't here.

The error is: ../../internal/handlers/handlers.go:12:2: No Go files in .../internal/handlers/tmpls

mxschmitt commented 5 years ago

Hi,

it's currently normal, because this FFSstring are the embedded assets, which are compiled into the binary. After go get has fetched the package, you only need to execute the Makefile by running make in the repository folder ($GOPATH/src....). (Tested it on my Mac)

miekg commented 5 years ago

ah, ok. But this falls down further along; esp as I'm building this using bazel. If anything needs to be generated it usually makes sense to just check that in, so a plain go build works.

mxschmitt commented 5 years ago

Yes, but I don't want to embed these auto generated files. Maybe it makes sense to switch to packr2, so this issue will not longer appear. Good alternative to esc. What are you using for embedding static assets into a bundle?

miekg commented 5 years ago

The normal Go way is to embed these so the entire thing just builds with 'go get/go install'

I'm not using js with Go, so can't comment on a good way to bundle these

mxschmitt commented 5 years ago

Okay, I fixed the the warning. The only requirement is now, that the frontend will be bundled manually on the client system.