Source File
serialize.go
Belonging Package
go/token
package token
func ( *FileSet) ( func(interface{}) error) error {
var serializedFileSet
if := (&); != nil {
return
}
.mutex.Lock()
.base = .Base
:= make([]*File, len(.Files))
for := 0; < len(.Files); ++ {
:= &.Files[]
[] = &File{
set: ,
name: .Name,
base: .Base,
size: .Size,
lines: .Lines,
infos: .Infos,
}
}
.files =
.last = nil
.mutex.Unlock()
return nil
}
func ( *FileSet) ( func(interface{}) error) error {
var serializedFileSet
.mutex.Lock()
.Base = .base
:= make([]serializedFile, len(.files))
for , := range .files {
.mutex.Lock()
[] = serializedFile{
Name: .name,
Base: .base,
Size: .size,
Lines: append([]int(nil), .lines...),
Infos: append([]lineInfo(nil), .infos...),
}
.mutex.Unlock()
}
.Files =
.mutex.Unlock()
return ()
![]() |
The pages are generated with Golds v0.3.2-preview. (GOOS=darwin GOARCH=amd64) Golds is a Go 101 project developed by Tapir Liu. PR and bug reports are welcome and can be submitted to the issue list. Please follow @Go100and1 (reachable from the left QR code) to get the latest news of Golds. |