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

Fixes #13 - AppIsConfigured to AppIfConfigured #14

Merged
merged 5 commits into from
Oct 3, 2023
Merged

Fixes #13 - AppIsConfigured to AppIfConfigured #14

merged 5 commits into from
Oct 3, 2023

Conversation

cowsay
Copy link
Contributor

@cowsay cowsay commented Oct 2, 2023

Also encountered this error so i changed to nil check instead of bool

/root/4/clienthellod/modcaddy/listener/listener.go:65:6: invalid operation: operator ! not defined on ctx.AppIfConfigured(app.CaddyAppID) (value of type any)
# github.com/gaukas/clienthellod/modcaddy/handler
/root/4/clienthellod/modcaddy/handler/handler.go:53:6: invalid operation: operator ! not defined on ctx.AppIfConfigured(app.CaddyAppID) (value of type any)```

@cowsay
Copy link
Contributor Author

cowsay commented Oct 2, 2023

Fixes #13

@gaukas gaukas linked an issue Oct 2, 2023 that may be closed by this pull request
@gaukas
Copy link
Owner

gaukas commented Oct 2, 2023

It might be better if you'd love to update the dependencies in go.mod (I guess that's why to Go build has failed). Or I can do that if it is inconvenient for you.

@gaukas
Copy link
Owner

gaukas commented Oct 2, 2023

And I'd suggest just combine the App() call with AppIfConfigured():

if app := AppIfConfigured(...); app == nil {
    // ...
} else {
    // ...
}

Since it is returning the App if it is configured.

gaukas added 3 commits October 2, 2023 18:38
- Update dependency to their latest
- Combined App configure check with assignment
Bump up go test runner version to Go 1.20 to be consistent with go.mod.

I am actually surprised that go.mod specifying Go 1.20 does not immediately fail on all older version Go.
@gaukas
Copy link
Owner

gaukas commented Oct 3, 2023

Oof. Seems like the latest Caddy does not support Go 1.20 am I right? Or something else happened.

@gaukas
Copy link
Owner

gaukas commented Oct 3, 2023

I see. Updating transitive dependencies breaks caddy. Bummer. People love breaking changes without new major version.

@gaukas
Copy link
Owner

gaukas commented Oct 3, 2023

Huzzah.

@gaukas gaukas merged commit 4d0fdb9 into gaukas:master Oct 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

xcaddy build failed ctx.AppIsConfigured undefined
2 participants