mirror of
https://github.com/golang/go
synced 2024-11-19 03:04:42 -07:00
b667c4c58e
This change removes the need for the ast and token fields on the *goFile object. We switch to using source.ParseGoHandles on the package, which means that we can easily access both the AST and token via the package, which is already cached. Change-Id: I5f78bbe09362f4d95eb15556617bdbd809a7a55d Reviewed-on: https://go-review.googlesource.com/c/tools/+/185878 Run-TryBot: Rebecca Stambler <rstambler@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Ian Cottrell <iancottrell@google.com>
25 lines
602 B
Go
25 lines
602 B
Go
// Copyright 2019 The Go Authors. All rights reserved.
|
|
// Use of this source code is governed by a BSD-style
|
|
// license that can be found in the LICENSE file.
|
|
|
|
package cache
|
|
|
|
import (
|
|
"context"
|
|
"fmt"
|
|
"go/token"
|
|
)
|
|
|
|
// modFile holds all of the information we know about a mod file.
|
|
type modFile struct {
|
|
fileBase
|
|
}
|
|
|
|
func (*modFile) GetToken(context.Context) (*token.File, error) {
|
|
return nil, fmt.Errorf("GetToken: not implemented")
|
|
}
|
|
|
|
func (*modFile) setContent(content []byte) {}
|
|
func (*modFile) filename() string { return "" }
|
|
func (*modFile) isActive() bool { return false }
|