parsefix

package
Version: v0.0.0-...-9562ee0 Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2019 License: BSD-2-Clause Imports: 4 Imported by: 0

Documentation

Overview

Package parsefix implements Go source file syntax errors fixing.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Repair

func Repair(code []byte, filename string, issues []string) ([]byte, error)

Repair tries to fix parsing issues inside the code.

Issues have a format of Go parser error messages. For example:

"foo/main.go:6:10: missing ',' in argument list"
"foo/main.go:9:3: expected '{', found 'EOF'"
"foo/main_test.go:13: expected statement, found ':='"

Note that messages can have different file reference. All issues those reference does not match specified filename argument are going to be skipped.

Returns nil if no issues were fixed. Returns non-nil byte slice of repaired code otherwise.

Types

This section is empty.

Jump to

Keyboard shortcuts

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