gomodifytype

command module
v0.0.0-...-2bcb28c Latest Latest
Warning

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

Go to latest
Published: May 12, 2021 License: MIT Imports: 14 Imported by: 0

README

Modify Go struct field type. It matches type by its string representation and replaces to another string.

Mostly useful for primitive types or types located in the same package. Maybe can be useful for external package types if followed by goimports.

My use case was replacing []byte type in a Protobuf generated code to custom Raw type.

Like this:

gomodifytype -file proxy.pb.go -all -w -from "[]byte" -to "Raw"

Thanks to https://github.com/fatih/gomodifytags for the AST modification example.

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

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