(spec string, input io.Reader)
| 227 | } |
| 228 | |
| 229 | func readSearchConsoleRequestBytes(spec string, input io.Reader) ([]byte, error) { |
| 230 | spec = strings.TrimSpace(spec) |
| 231 | switch { |
| 232 | case spec == "", spec == "-", strings.HasPrefix(spec, "@"), strings.HasPrefix(spec, "{"), strings.HasPrefix(spec, "["): |
| 233 | return resolveInlineOrFileBytes(spec, input) |
| 234 | default: |
| 235 | path, err := config.ExpandPath(spec) |
| 236 | if err != nil { |
| 237 | return nil, err |
| 238 | } |
| 239 | return os.ReadFile(path) //nolint:gosec // user-provided path |
| 240 | } |
| 241 | } |
| 242 | |
| 243 | func parseSearchConsoleDate(value string, flagName string) (string, error) { |
| 244 | value = strings.TrimSpace(value) |
no test coverage detected