Skip to content

Package srcutil provides utilities for working with Go source code.

License

Notifications You must be signed in to change notification settings

cstockton/go-srcutil

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Go Package: srcutil

About | Go Doc

Get:

go get -u github.com/cstockton/go-srcutil

Example:

pkg, err := srcutil.Import("io")
if err != nil {	log.Fatal(err) }
fmt.Printf("// %s: %s\n", pkg, pkg.Doc)

vars := pkg.Vars()
for _, v := range vars {
  fmt.Printf("var %v %v\n", v.Name(), v.Type())
}

Output

// io: Package io provides basic interfaces to I/O primitives.
var EOF error
var ErrClosedPipe error
var ErrNoProgress error
var ErrShortBuffer error
var ErrShortWrite error
var ErrUnexpectedEOF error

About

Package srcutil provides utilities for working with Go source code. The Go standard library provides a powerful suite of packages "go/{ast,doc,...}" which are used by the Go tool chain to compile Go programs. As you initially try to find your way around you hit a small dependency barrier and have to learn a small portion of each package. There is a fantastic write up and collection of examples that I used to learn (or shamelessly copy pasta'd) while creating this package, currently maintained by:

  Alan Donovan (https://github.com/golang/example/tree/master/gotypes)

In the mean time this package can help you get started with some common use cases.

Bugs and Patches

Feel free to report bugs and submit pull requests.

About

Package srcutil provides utilities for working with Go source code.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages