Skip to content
utility functions for Go types based on reflect package
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
collections
errors
structs
Dockerfile
go.mod
go.sum
readme.MD

readme.MD

Types

Types uses reflection and other internal packages to extends the functionality of existing data structures and provides implementations of other common data structures

What data structures are supported by Types?

Types provides implementations of structs, lists, and queues Support for data structures such sets, stacks, and dictionaries/maps coming soon!

Installation (Package)

$ go get github.com/ShockNode/types

Usage

import "github.com/ShockNode/types/structs"

type S struct {

  Id int
  Name string

}

s := &S{Id: 1, Name: "Brent"}

//Valid. Returns *field, error
f1, err := types.Struct(s).FieldByName("Name")

//Also valid. Also returns *field, error
f2, err := structs.Struct(s).FieldByIndex(0)

err = f1.Set("B. Ray")

fmt.Printf("Name of struct field at index 0: %s", f2.Name())

Development:

Types is under active development. Most things will remain the same, but nonetheless minor changes will occur.

Contributors
Brent Ray (Owner)
You can’t perform that action at this time.