buildissues

package
v0.1.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 20, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package buildissues parses the textual output of the Go toolchain (go build, go vet, go test) into structured issues suitable for an Issues pane. It is UI-agnostic and depends only on the standard library.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Issue

type Issue struct {
	File     string
	Line     int
	Col      int
	Severity Severity
	Message  string
}

Issue is a single diagnostic located at File:Line[:Col]. Col is 0 when the tool reported no column.

func Parse

func Parse(output string) []Issue

Parse scans tool output and returns one Issue per recognized diagnostic line, in source order. It returns nil when there are no issues.

Recognized: any line whose whitespace-trimmed form begins with a "file.ext:line: msg" or "file.ext:line:col: msg" location prefix. This covers compiler errors, go vet reports, and the indented "file:line: msg" details that go test prints beneath a "--- FAIL" header.

Ignored (kept out of the result): blank lines; package-context headers beginning with "# " (e.g. "# github.com/x/y"); test-runner status lines such as "ok pkg", "--- FAIL", "=== RUN", "PASS", "FAIL"; panic messages; and goroutine stack-trace frames ("file.go:10 +0x20") — none carry a "file.ext:line[:col]: " prefix, so they never match. Pseudo-locations without an extension (e.g. "<autogenerated>:1:") are likewise treated as non-issues.

Severity: a diagnostic whose message contains "warning:" is a Warning; every other recognized diagnostic is an Error.

type Severity

type Severity int

Severity classifies how serious an Issue is.

const (
	// Error is a compiler or go vet diagnostic (the default classification).
	Error Severity = iota
	// Warning is a non-fatal diagnostic, e.g. a cgo/C compiler "warning:".
	Warning
	// Info is a purely informational note.
	Info
)

func (Severity) String

func (s Severity) String() string

String returns the lowercase name of the severity.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL