Skip to content

Conversation

0xk1f0
Copy link
Contributor

@0xk1f0 0xk1f0 commented Jul 6, 2025

Since Go 1.22, we have the ability to create a request multiplexer using http.ServeMux with native libraries. This makes the gorilla/mux library obsolete (which also hasn't received any new commits for over a year now).

This PR removes usage of gorilla/mux for the incus_agent as a start. I do think it would be a wise decision to adopt this for all usages of it in this repository eventually.

@0xk1f0 0xk1f0 requested a review from stgraber as a code owner July 6, 2025 18:52
@stgraber
Copy link
Member

stgraber commented Jul 7, 2025

Yeah, we've moved away from gorilla/mux in some of the new projects (incus-os, migration-manager, operations-center) and it's been working well. Makes sense to start doing it here too.

@stgraber stgraber enabled auto-merge July 7, 2025 14:58
@stgraber
Copy link
Member

stgraber commented Jul 7, 2025

 Error: cmd/incus-agent/operations.go:178:10: indent-error-flow: if block ends with a return statement, so drop this else and outdent its block (revive)
		} else {
			timeoutSecs = formTimeout
		}
1 issues:

(Note that we have static-analysis configured to be stricter on modified code than on existing code, so it may trigger on code that you didn't introduce, that's normal, it just forces us to progressively fix those things)

Signed-off-by: 0xk1f0 <dev@k1f0.dev>
auto-merge was automatically disabled July 7, 2025 15:30

Head branch was pushed to by a user without write access

@0xk1f0
Copy link
Contributor Author

0xk1f0 commented Jul 7, 2025

Fixed that, should be cleaner now.

@stgraber stgraber merged commit c1175be into lxc:main Jul 7, 2025
35 of 38 checks passed
@0xk1f0 0xk1f0 deleted the incus_agent branch July 7, 2025 18:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants