INNER CODE UNIT · Go

reportError

Netis/cloud-probe · cpctl/cmd/base.go:91

func reportError(l *slog.Logger, err error) {
	l.Error("command failed", slog.String("err", err.Error()))
}

// NormalizeFormat collapses jsonl/ndjson aliases to the canonical "jsonl"
// and validates that the value is one of the supported formats.
func NormalizeFormat(format *string) error {
	switch strings.ToLower(*format) {
	case FormatText:
		*format = FormatText
	case FormatJSONL, "ndjson":
		*format = FormatJSONL
	default:
		return fmt.Errorf("invalid --format %q (text|jsonl, ndjson accepted as alias)", *format)
	}
	return nil
}

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…