gcode

package module
v0.0.0 Latest Latest
Warning

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

Go to latest
Published: Jan 14, 2024 License: MIT Imports: 5 Imported by: 1

README

gcode

a generate library for go code

demo

	code := `package aa`
	bs, err := AddImport([]byte(code), "arr", "github.com/lingdor/magicarray")
	if err != nil {
		panic(err)
	}
    fmt.Println(string(bs))

output:

package aa
import(
arr "github.com/lingdor/magicarray"
)

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNoPackage = errors.New("no found package declaration")

Functions

func AddImport

func AddImport(code []byte, name, 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