initial commit
This commit is contained in:
27
main.go
Normal file
27
main.go
Normal file
@@ -0,0 +1,27 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"json-dataloader-golang/core"
|
||||
"json-dataloader-golang/utils"
|
||||
)
|
||||
|
||||
type SampleData struct {
|
||||
Data string `json:"data"`
|
||||
}
|
||||
|
||||
func (receiver *SampleData) Default() {
|
||||
receiver.Data = "default"
|
||||
}
|
||||
|
||||
func main() {
|
||||
data := SampleData{}
|
||||
|
||||
dataClipBuilder := core.DataClipBuilder{}
|
||||
dataClipBuilder.InFile("config.json")
|
||||
dataClipBuilder.RegisterType(data)
|
||||
|
||||
dataClip := dataClipBuilder.Build()
|
||||
data = dataClip.Setup(data).(SampleData)
|
||||
|
||||
utils.PrintStruct(data, "", false)
|
||||
}
|
Reference in New Issue
Block a user