Skip to content

codegold79/mutastruct

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

mutastruct

Use the reflect package to make changes to a struct in an atypical manner.

To use, import the mutastruct package.

Call the following function to set a struct field.

func Set(anyStruct any, fieldName string, setting any) error {
    ...
}

The first argument must be a pointer to a struct. The last parameter, setting, is the desired value of the field specified by fieldName (the second parameter). The setting argument must be the same type as the field you wish to change.

About

Use reflect package to do atypical changes to struct types.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages