Beispiel #1
0
Datei: test.go Projekt: Wuyue/Gsm
func (t *Test) Save() error {
	fmt.Println("Save Begining...")

	t.Ip = "1111"
	t.Int8 = 12
	t.Int16 = 1213
	t.Int32 = 121312
	t.Int64 = 1213123
	t.Fat32 = 3.1415
	t.Fat64 = 3.1415926
	t.Name = "sdf"
	t.Ok = true
	t.ArrayInt = []int{1, 2, 3, 4, 5}
	t.ArrayInt8 = []int8{2, 3, 4, 5, 6}
	t.ArrayInt16 = []int16{4, 5, 6, 7, 7}
	t.ArrayInt32 = []int32{5, 6, 7, 8, 9}
	t.ArrayInt64 = []int64{7, 6, 5, 4, 3}
	t.ArrayString = []string{"a", "b", "c"}
	t.ArrayBool = []bool{true, false, true, true}
	t.ArrayFloat32 = []float32{1.1111, 1.22222, 1.33333}
	t.ArrayFloat64 = []float64{2.33333333, 2.444444444, 2.12345}

	err := gsm.Save(t)
	if err != nil {
		fmt.Println("ERRORS:", err)
		return err
	}
	t.Putout()
	return nil
}
Beispiel #2
0
func (tb *TestB) Save() {
	tb.String = "TestB"
	gsm.Save(tb)
}
Beispiel #3
0
func (ta *TestA) Save() {
	ta.String = "TestA"
	gsm.Save(ta)
}