gpk

package module
v1.1.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 7, 2015 License: MIT Imports: 13 Imported by: 0

README

gpk

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DEBUG bool
View Source
var ErrInvalidGithubPath = errors.New("invalid github path")
View Source
var ErrInvalidGoPkginPath = errors.New("invalid gopkg.in path")
View Source
var ErrInvalidGoPkginVersion = errors.New("invalid gopkg.in version string")
View Source
var ErrNoGoPkginPath = errors.New("no gopkg.in path")

Functions

func Dependents

func Dependents(dir, p string) ([]string, error)

Dependents returns packages inside the given dir that are dependent of the given package, because they import it does not look into directories that begin with the dot

func DependentsPrefix

func DependentsPrefix(dir, relPath string) ([]string, error)

DependentsPrefix is like DependentsPrefix, but relPath is a package path, not a directory

func ExtImports

func ExtImports(dir string) ([]string, error)

ExtImports returns the imports of a package that are not part of the standard library

func GOPATH

func GOPATH(pkg *build.Package) string

GOPATH returns the gopath of a package

func GithubPath

func GithubPath(p string) (string, error)

GithubPath returns the github path for the gopkg.in path

func GoGetAndInstall

func GoGetAndInstall(src, pkgPath string) error

func GoPkginPath

func GoPkginPath(p string, version [3]int) (string, error)

GoPkginPath returns the versioned gopkg.in path for a package

func GoPkginVersion

func GoPkginVersion(path string) (version [3]int, err error)

GoPkginVersion parses major minor and patch version out of a gopkg.in package string

func Imports

func Imports(dir string) ([]string, error)

Imports returns the imports of a package

func InGoPkgin

func InGoPkgin(path string) bool

InGoPkgIn checks if the given path is in gopkg.in

func LastVersion

func LastVersion(versions ...string) ([3]int, error)

LastVersion returns the last version of a version slice like this []string{"v1","v5", "v1.10"}

func Pkg

func Pkg(dir string) (*build.Package, error)

func PkgPath

func PkgPath(pkg *build.Package) (string, error)

func PushNewMajor

func PushNewMajor(dir string) ([3]int, error)

func PushNewMinor

func PushNewMinor(dir string) ([3]int, error)

func PushNewPatch

func PushNewPatch(dir string) ([3]int, error)

func ReplaceImport added in v1.1.1

func ReplaceImport(pkgDir, original, target string) (err error)

func ReplaceWithGithubPath

func ReplaceWithGithubPath(pkgDir string) error

ReplaceWithGithubPath takes a pkg pkgDir that is a GithubPath. It replaces inside every file inside every package beneath the given dir an string that references any gopkg variant of the given package by the github variant It can be used for developement to be able to run the tests, switch back by calling ReplaceWithGopkginPath

func ReplaceWithGopkginPath

func ReplaceWithGopkginPath(pkgdir string, version [3]int) error

ReplaceWithGithubPath takes a pkg pkgDir that is a GithubPath. It replaces inside every file inside every package beneath the given dir an string that references any github or gopkgin variant of the given package by the gopkg variant with the given version. It can be used to release a package after ReplaceWithGithubPath has been used or to update a version number

func SetNewMajor

func SetNewMajor(dir string) ([3]int, error)

func SetNewMinor

func SetNewMinor(dir string) ([3]int, error)

func SetNewPatch

func SetNewPatch(dir string) ([3]int, error)

func StdImports

func StdImports(dir string) ([]string, error)

StdImports returns the imports of a package that are part of the standard library

func VersionString

func VersionString(version [3]int) string

VersionString returns something like v2.4 for [3]int{2,4,0}

Types

This section is empty.

Directories

Path Synopsis
cmd
gpk

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL