Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: show templ CLI and go.mod version mismatch warning #338

Merged
merged 3 commits into from
Dec 17, 2023
Merged

Conversation

a-h
Copy link
Owner

@a-h a-h commented Dec 17, 2023

Fixes #249

Screenshot 2023-12-17 at 20 24 02

@a-h a-h changed the title Added templ CLI and go.mod version mismatch warning feat: show templ CLI and go.mod version mismatch warning Dec 17, 2023
@a-h a-h merged commit f217754 into main Dec 17, 2023
7 checks passed
@a-h a-h deleted the issue_249 branch December 17, 2023 21:02
@kron4eg
Copy link

kron4eg commented Dec 22, 2023

After recent update of Go and running go mod tidy my go.mod looks like this:

diff --git go.mod go.mod
index d33db29..76bfbda 100644
--- go.mod
+++ go.mod
@@ -2,8 +2,10 @@ module exp2

 go 1.21.4

+toolchain go1.21.5
+
 require (
-       github.com/a-h/templ v0.2.476
+       github.com/a-h/templ v0.2.501

Which results to the error:

(✓) Generated code for 2 templates with 0 errors in 2.108317ms
(!) templ version check failed: failed to parse go.mod file: <...>/src/backend/go.mod:3: invalid go version '1.21.4': must match format 1.23
<...>/src/backend/go.mod:5: unknown directive: toolchain

@a-h
Copy link
Owner Author

a-h commented Dec 22, 2023

Ah yes, just noticed it. Sorry about that... #355

I think the temp solution while the go module parser issue is open is to regexp out the final part of the version before parsing.

I might have time to do that tomorrow and put out a tiny release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants