Documentation ¶
Index ¶
- Constants
- func DownloadPackage(url string, dlCallback func(totalSize int64, src io.Reader) error) (size int64, err error)
- func DownloadUrl(version VersionInfo, os, arch string) string
- func ExtractArchive(srcFile *os.File, size int64, targetPath string, ...) error
- func GoPath(exePath string) (string, error)
- func RecursiveCopyDir(src, dst string) error
- type VersionInfo
Constants ¶
View Source
const ( RelVerURL = "https://go.googlesource.com/go/+refs" DownloadURLWithPattern = "https://dl.google.com/go/go[version].[os]-[arch].[ext]" )
View Source
const ( Format = "tar.gz" DefaultInstallDir = "/usr/local/go/bin" )
View Source
const (
BufSize = 10 * 1024
)
Variables ¶
This section is empty.
Functions ¶
func DownloadPackage ¶
func DownloadPackage(url string, dlCallback func(totalSize int64, src io.Reader) error) (size int64, err error)
DownloadPackage downloads Go compiled binaries from dl.google.com version: Go version arch: Go architecture
func DownloadUrl ¶
func DownloadUrl(version VersionInfo, os, arch string) string
func ExtractArchive ¶
func RecursiveCopyDir ¶
Types ¶
type VersionInfo ¶
type VersionInfo struct { Major int Minor int Build int RC bool RCVersion int Beta bool BetaVersion int }
func ExtractVersionInfo ¶
func ExtractVersionInfo(version string) (versionInfo VersionInfo, err error)
func LatestVersionInfo ¶
func LatestVersionInfo() (versionInfo []VersionInfo, err error)
LatestVersionInfo returns all version (defined in GoogleSource) available in a slice
func LocalGoInfo ¶
func LocalGoInfo(exePath string) (ver VersionInfo, os, arch string, err error)
LocalGoInfo returns local Go version numbers, OS and Arch
func (VersionInfo) String ¶
func (vi VersionInfo) String() string
Click to show internal directories.
Click to hide internal directories.