Popularity
1.8
Declining
Activity
0.0
Stable
17
3
4

Programming language: Go
License: MIT License
Tags: Utilities    

filler alternatives and similar packages

Based on the "Utilities" category.
Alternatively, view filler alternatives based on common mentions on social networks and blogs.

Do you think we are missing an alternative of filler or a related project?

Add another 'Utilities' Package

README

filler Go Report Card Build Status GoDoc

small util to fill gaps in your structs

Installation

$ go get github.com/yaronsumel/filler

Usage

package main

import (
    "fmt"
    "github.com/yaronsumel/filler"
)

type model struct {
    UserID   string
    UserName string `fill:"UserNameFiller:UserID"`
}

func init() {
    filler.RegFiller("UserNameFiller", func(value interface{}) (interface{}, error) {
        return "UserId" + value.(string), nil
    })
}

func main() {
    m := &model{
        UserID: "123",
    }
    fmt.Printf("%+v\n", m)
    // should print `&{UserId:123 UserName:}`
    filler.Fill(m)
    // should print `&{UserId:123 UserName:UserId123}`
    fmt.Printf("%+v\n", m)
}


Written and Maintained by @YaronSumel