lintservemux

package module
v0.0.0-...-38db572 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 23, 2023 License: MIT Imports: 4 Imported by: 3

README

lintservemux

An analyzer to detect uses of the default http.ServeMux in Go programs

CircleCI codecov

Serving traffic with the default http.ServeMux has some risks! If anything you import calls http.Handle(), it will get served on the same port as your application.

In particular, importing net/http/pprof registers things on the default ServeMux.

This linter tries to help avoid that by flagging uses of http.Handle() and http.HandleFunc(), calling ListenAndServe() with a nil Handler argument, or creating an http.Server with a nil Handler argument.

Documentation

Index

Constants

View Source
const Doc = `check for uses of http.DefaultServeMux`

Variables

View Source
var Analyzer = &analysis.Analyzer{
	Doc:      Doc,
	Name:     "lintservemux",
	Run:      lintservemuxCheck,
	Requires: []*analysis.Analyzer{inspect.Analyzer},
}

Functions

This section is empty.

Types

This section is empty.

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL