Skip to content
asciimothPublic

About

Go library for document's content modification

Resources

Stars

2 stars

Watchers

0 watching

Forks

Latest commit

 

History

13 Commits

Folders and files

Repository files navigation

inplace

Go library for document's content modification

import (
    "os"

	"github.com/asciimoth/inplace"
	"github.com/asciimoth/inplace/toml"
)

func main() {
    root, _ := os.OpenRoot(".")
    _ = inplace.PatchFile(
        toml.New,
        root,
        "Cargo.toml",
		[]inplace.Patch{
			{
				KP:    []string{"package", "name"},
				Value: "NEWNAME",
			},
			{
				KP:    []string{"package", "version"},
				Value: "3.1.4",
			},
		},
    )
}

Note that this library created for specific cases with simple scalar values manipulation.
If you need more complex ast manipulation check this libs:

If you need to just marshal/unmarshal formats to go data structures check this:

About

Go library for document's content modification

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages