Documentation ¶
Overview ¶
Package fs provides utility functions to work with sources files relate to standard golang workspace. It's using GOROOT and GOHOME environment variables to search.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetPackagePath ¶
GetPackagePath return relative path to standard go workspace layout - GOPATH/src and GOROOT/src and trims file name if it presents.
func GetRelativePath ¶
GetRelativePath returns relative path to $GOPATH or $GOROOT env variable.
func GetUnusedSources ¶
GetUnusedSources returns list of source files in package that are not presenting in the file set
func ReplaceStringInFile ¶
ReplaceStringInFile replaces string in the file at the given offset. There are next steps to do that: * Storing the content that starts after replacing string * Truncate file from the offset * Append new string * Append rest of the file that was stored on the first step
func SourceFiles ¶
GetFiles returns all golang source files which is inside a package. A path to the package is constructing using standard workspace layout - $GOPATH/src. All tests files are ignored. If deep flag is true then will return files from all subpackages as well. It collects only files that name ends with .go extension. Returns list of full file names.
Types ¶
This section is empty.