util

package
v1.1.2 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2024 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Overview

This package is dedicated to exec.Command related calls

Licensed Materials - Property of IBM Copyright IBM Corp. 2023. US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.

This package is deidcated to modifying and checking the environment settings

Licensed Materials - Property of IBM Copyright IBM Corp. 2023. US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.

Index

Constants

View Source
const INTERNAL_PATH_PREFIX = "//:INTERNAL/"

Variables

This section is empty.

Functions

func AppendTagString

func AppendTagString(src []byte, tag string, op string, notice string) ([]byte, error)

Adds the 'zos' build tag to a file

func CloneModuleFromCache added in v1.1.0

func CloneModuleFromCache(srcdir string, dstdir string, modpath string) error

Copies a module to the given path

func CloneModuleFromVCS added in v1.1.0

func CloneModuleFromVCS(dstdir string, modpath string, version string) error

Copies a module to the given path

func CopyFile

func CopyFile(dst, src string) error

Util copy file function

func Format

func Format(src *ast.File, fset *token.FileSet) ([]byte, error)

func GitClone

func GitClone(repo string, dest string) error

Git clone a repository

func GoBuild

func GoBuild(paths []string) (string, error)

Run go build on the command line

func GoEnv

func GoEnv() (map[string]string, error)

Run go env and return all it's contents

func GoList

func GoList(pkgs []string) (string, error)

Run go list

func GoListModMain

func GoListModMain(mod string) error

func GoListModUpdate

func GoListModUpdate(mod string) (string, error)

Run go list -m -u

func GoListPkgDir

func GoListPkgDir(pkg string) (string, error)

Run go list -find

func GoModInit

func GoModInit(dir string, path string) error

Init go.mod

func GoModTidy

func GoModTidy() error

Tidy go.mod

func GoTest

func GoTest(paths []string) (string, error)

Run tests on a package

func GoWorkEditDropReplace

func GoWorkEditDropReplace(path string) error

Drop replace entry in go.mod

func GoWorkEditReplaceVersion

func GoWorkEditReplaceVersion(path string, version string) error

Replace entry in go.mod

func GoWorkUse

func GoWorkUse(path string) error

func Patch

func Patch(target string, output string, diff []byte) error

Run the patch command

func ReadFile

func ReadFile(path string) ([]byte, error)

Types

This section is empty.

Jump to

Keyboard shortcuts

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