OXIESEC PANEL
- Current Dir:
/
/
opt
/
golang
/
1.19.4
/
src
/
go
/
parser
Server IP: 2a02:4780:11:1084:0:327f:3464:10
Upload:
Create Dir:
Name
Size
Modified
Perms
📁
..
-
12/01/2022 06:13:56 PM
rwxr-xr-x
📄
error_test.go
5.83 KB
12/01/2022 06:12:58 PM
rw-r--r--
📄
example_test.go
715 bytes
12/01/2022 06:12:58 PM
rw-r--r--
📄
interface.go
7.37 KB
12/01/2022 06:12:58 PM
rw-r--r--
📄
parser.go
72.88 KB
12/01/2022 06:12:58 PM
rw-r--r--
📄
parser_test.go
22.25 KB
12/01/2022 06:12:58 PM
rw-r--r--
📄
performance_test.go
1.34 KB
12/01/2022 06:12:58 PM
rw-r--r--
📄
resolver.go
15.76 KB
12/01/2022 06:12:58 PM
rw-r--r--
📄
resolver_test.go
5.03 KB
12/01/2022 06:12:58 PM
rw-r--r--
📄
short_test.go
15.27 KB
12/01/2022 06:12:58 PM
rw-r--r--
📁
testdata
-
12/01/2022 06:13:56 PM
rwxr-xr-x
Editing: example_test.go
Close
// Copyright 2012 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 parser_test import ( "fmt" "go/parser" "go/token" ) func ExampleParseFile() { fset := token.NewFileSet() // positions are relative to fset src := `package foo import ( "fmt" "time" ) func bar() { fmt.Println(time.Now()) }` // Parse src but stop after processing the imports. f, err := parser.ParseFile(fset, "", src, parser.ImportsOnly) if err != nil { fmt.Println(err) return } // Print the imports from the file's AST. for _, s := range f.Imports { fmt.Println(s.Path.Value) } // output: // // "fmt" // "time" }