location.go

 1package ast
 2
 3import (
 4	"github.com/graphql-go/graphql/language/source"
 5)
 6
 7type Location struct {
 8	Start  int
 9	End    int
10	Source *source.Source
11}
12
13func NewLocation(loc *Location) *Location {
14	if loc == nil {
15		loc = &Location{}
16	}
17	return &Location{
18		Start:  loc.Start,
19		End:    loc.End,
20		Source: loc.Source,
21	}
22}