Documentation
¶
Index ¶
- func GoModDropReplace(modulePath string, opts *GoModEditOptions) error
- func GoModEditReplace(modulePath, replacement string, opts *GoModEditOptions) error
- func GoModEditRequire(modulePath, version string, opts *GoModEditOptions) error
- func GoModTidy(opts *GoModEditOptions) error
- func GoToolNM(binary string) (string, error)
- func GoToolObjdump(args ...string) (string, error)
- type GoMod
- type GoModEditOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GoModDropReplace ¶
func GoModDropReplace(modulePath string, opts *GoModEditOptions) error
GoModDropReplace executes "go mod edit -dropreplace" to remove a replacement directive
func GoModEditReplace ¶
func GoModEditReplace(modulePath, replacement string, opts *GoModEditOptions) error
GoModEditReplace executes "go mod edit -replace" to add a replacement directive
func GoModEditRequire ¶
func GoModEditRequire(modulePath, version string, opts *GoModEditOptions) error
GoModEditRequire executes "go mod edit -require" to update module version
func GoModTidy ¶
func GoModTidy(opts *GoModEditOptions) error
GoModTidy executes "go mod tidy" in the specified directory
func GoToolObjdump ¶
GoToolObjdump executes "go tool objdump" with the specified arguments
Types ¶
type GoMod ¶
type GoMod struct {
Module struct {
Path string `json:"Path"`
} `json:"Module"`
Require []struct {
Path string `json:"Path"`
Version string `json:"Version"`
} `json:"Require"`
Replace []struct {
Old struct {
Path string `json:"Path"`
} `json:"Old"`
New struct {
Path string `json:"Path"`
Version string `json:"Version"`
} `json:"New"`
} `json:"Replace"`
}
GoMod represents the structure returned by "go mod edit -json"
func GoModEditJSON ¶
func GoModEditJSON(opts *GoModEditOptions) (*GoMod, error)
GoModEditJSON executes "go mod edit -json" and returns the parsed module information
type GoModEditOptions ¶
type GoModEditOptions struct {
Dir string // Working directory for the command
Stderr bool // Whether to show stderr output
Stdout bool // Whether to show stdout output
}
GoModEditOptions represents options for go mod edit commands
func DefaultGoModEditOptions ¶
func DefaultGoModEditOptions() *GoModEditOptions
DefaultGoModEditOptions returns default options for go mod edit commands