GetInputSource determines the source of input and returns the content.
(arg string)
| 213 | |
| 214 | // GetInputSource determines the source of input and returns the content. |
| 215 | func GetInputSource(arg string) (*InputResult, error) { |
| 216 | if arg == "-" { |
| 217 | content, err := ReadFromStdin() |
| 218 | if err != nil { |
| 219 | return nil, err |
| 220 | } |
| 221 | return &InputResult{ |
| 222 | Type: InputTypeSQL, |
| 223 | Content: content, |
| 224 | Source: "stdin", |
| 225 | }, nil |
| 226 | } |
| 227 | |
| 228 | return DetectAndReadInput(arg) |
| 229 | } |
| 230 | |
| 231 | // WriteOutput writes content to the specified output destination. |
| 232 | func WriteOutput(content []byte, outputFile string, writer io.Writer) error { |
no test coverage detected