Skip to content

Go 1.22 ServeMux documentation #113

@halon176

Description

@halon176

I'm not entirely certain, but I'm wondering if it's possible to use Swaggo along with this package to document a Mux server without the use of Chi (as seen in most examples). Specifically, I'm interested in documenting a server structured like this:

package main

import (
	"net/http"
)



func main() {
	mux := http.NewServeMux()
	mux.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
		w.Write([]byte("Hello, World!"))
	})

	http.ListenAndServe(":8080", mux)
}

In theory, since this follows a net/http structure, it seems feasible that this package could be utilized to document this type of API.

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions