Skip to content

Latest commit

 

History

History
47 lines (43 loc) · 1010 Bytes

README.md

File metadata and controls

47 lines (43 loc) · 1010 Bytes

gob


gob is a library that provides common golang's object process.
This README is still not fully completed yet, will be updated shortly. The codes were co-created with @johnjerrico, published here so it can be used publicly.

Installation


Get the code with:

$ go get github.com/louvri/gob

Usage


  • Array/Slice
      ...
      source := []string{"A", "B", "C", "D"}
      ...
      indexMap := arr.Index(source)
      if indexMap["A"] {
      ...
      }
      ...
    
  • Object
      ...
      if !object.IsEmpty(objB) {
          err := object.Assign(objA, prop, object.Get(objB))
          if err != nil {
              fmt.Println(err)
          }
      }
      ...
    
  • String
      ...
      if tmp := str.SplitOnNotEmpty("id:desc", ":"); len(tmp) > 0 {
          ...
      }
      ...