fieldtags

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2020 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package fieldtags defines an analyzer that identifies struct fields identified as sources via a field tag.

Index

Constants

This section is empty.

Variables

View Source
var Analyzer = &analysis.Analyzer{
	Name: "fieldtags",
	Doc:  "This analyzer identifies Source fields based on their tags. Tags are expected to satisfy the `go vet -structtag` format.",
	Run:  run,
	Requires: []*analysis.Analyzer{
		inspect.Analyzer,
	},
	ResultType: reflect.TypeOf(new(ResultType)).Elem(),
}

Functions

This section is empty.

Types

type ResultType

type ResultType = TaggedFields

ResultType is a slice of TaggedFields.

type TaggedField

type TaggedField struct {
	// contains filtered or unexported fields
}

A TaggedField contains the necessary information to identify a tagged struct field.

func (TaggedField) String

func (t TaggedField) String() string

type TaggedFields

type TaggedFields []TaggedField

TaggedFields is named type representing a slice of TaggedFields.

func (TaggedFields) IsSource

func (t TaggedFields) IsSource(f *ssa.FieldAddr) bool

IsSource determines whether a FieldAddr is a source, that is whether it refers to a field previously identified as a source.

Jump to

Keyboard shortcuts

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