blob: d8002bca845c559980117f6b6e92076573d66de5 [file] [log] [blame]
// +build ignore
package main
import (
"fmt"
"go/parser"
"go/token"
"strconv"
)
func main() {
src := `package hack; import "net/http"; var i http.Handler`
fset := token.NewFileSet()
f, _ := parser.ParseFile(fset, "", src, 0)
raw := f.Imports[0].Path.Value
path, _ := strconv.Unquote(raw)
fmt.Println(raw, "\n", path)
}