(args []string)
| 25 | } |
| 26 | |
| 27 | func (c *FetchCommand) Execute(args []string) error { |
| 28 | if len(args) < 1 { |
| 29 | return newError("empty url") |
| 30 | } |
| 31 | content, err := FetchHTTPContent(args[0]) |
| 32 | if err != nil { |
| 33 | return newError("failed to read HTTP response").Base(err) |
| 34 | } |
| 35 | |
| 36 | os.Stdout.Write(content) |
| 37 | return nil |
| 38 | } |
| 39 | |
| 40 | // FetchHTTPContent dials https for remote content |
| 41 | func FetchHTTPContent(target string) ([]byte, error) { |
nothing calls this directly
no test coverage detected