tools

package
v0.0.0-...-5f77fab Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2019 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetAllImportPaths

func GetAllImportPaths() ([]string, error)

Types

type AddCommentsResult

type AddCommentsResult struct {
	Pos  int    `json:"pos"`
	Text string `json:"text"`
}

func AddComments

func AddComments(filename string, isRuneCount bool) (out []AddCommentsResult, err error)

type AddImportResult

type AddImportResult struct {
	// L/Rpos - position on original file
	// it means old import block declaration
	Lpos int64 `json:"l_pos"`
	Rpos int64 `json:"r_pos"`

	// Text for replace on original place with new import block
	Text string `json:"text"`
}

AddImportResult - result of add_import command

func AddImport

func AddImport(filename string, importName string) (*AddImportResult, error)

AddImport - add import to go source file

type Func

type Func struct {
	Name   string
	Params []Param
	Res    []Param
}

Func represents a function signature.

type Method

type Method struct {
	Recv string
	Func
}

Method represents a method signature.

type Param

type Param struct {
	Name string
	Type string
}

Param represents a parameter in a function or method signature.

type Pkg

type Pkg struct {
	*build.Package
	*token.FileSet
}

Pkg is a parsed build.Package.

Jump to

Keyboard shortcuts

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