Fast and extensible multi-platform HTTP/1-2-3 web server with automatic HTTPS
Mirrored from https://github.com/Slazee/caddy.git
Synced Nov 11, 01:00 UTC
| 1 | package warning |
| 2 | |
| 3 | import "fmt" |
| 4 | |
| 5 | // Warning represents a warning or notice related to conversion. |
| 6 | type Warning struct { |
| 7 | File string `json:"file,omitempty"` |
| 8 | Line int `json:"line,omitempty"` |
| 9 | Directive string `json:"directive,omitempty"` |
| 10 | Message string `json:"message,omitempty"` |
| 11 | } |
| 12 | |
| 13 | func (w Warning) String() string { |
| 14 | var directive string |
| 15 | if w.Directive != "" { |
| 16 | directive = fmt.Sprintf(" (%s)", w.Directive) |
| 17 | } |
| 18 | return fmt.Sprintf("%s:%d%s: %s", w.File, w.Line, directive, w.Message) |
| 19 | } |