mirror of
https://github.com/caddyserver/caddy.git
synced 2026-11-19 22:39:38 +00:00
* admin: fix warnings and status code in /load API * fix admin.go: gci import formatting --------- Signed-off-by: Matt Holt <mholt@users.noreply.github.com> Co-authored-by: Matt Holt <mholt@users.noreply.github.com>
19 lines
504 B
Go
19 lines
504 B
Go
package warning
|
|
|
|
import "fmt"
|
|
|
|
// Warning represents a warning or notice related to conversion.
|
|
type Warning struct {
|
|
File string `json:"file,omitempty"`
|
|
Line int `json:"line,omitempty"`
|
|
Directive string `json:"directive,omitempty"`
|
|
Message string `json:"message,omitempty"`
|
|
}
|
|
|
|
func (w Warning) String() string {
|
|
var directive string
|
|
if w.Directive != "" {
|
|
directive = fmt.Sprintf(" (%s)", w.Directive)
|
|
}
|
|
return fmt.Sprintf("%s:%d%s: %s", w.File, w.Line, directive, w.Message)
|
|
}
|