generate

package
v0.71.12 Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2023 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExternalModule

func ExternalModule(w io.Writer, module *schema.Module, importRoot string) error

ExternalModule Go stubs for the given module.

func File

func File[T any](path string, importRoot string, generator func(io.Writer, T, string) error, parameter T) error

File is a helper function for the generator functions in this package, to create a file and its parent directories, then call a generator function.

func GenerateGoMod

func GenerateGoMod(w io.Writer, config GoModConfig, importRoot string) error

GenerateGoMod generates a go.mod file.

func GenerateGoWork

func GenerateGoWork(w io.Writer, modules []string, importRoot string) error

GenerateGoWork generates a go.work file.

func Main

func Main(w io.Writer, module *schema.Module, importRoot string) error

Types

type GoModConfig

type GoModConfig struct {
	// Replace directives
	Replace map[string]string
}

Jump to

Keyboard shortcuts

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