github.com/gogf/gf/v2@v2.7.4/os/gstructs/gstructs_type.go (about)

     1  // Copyright GoFrame Author(https://goframe.org). All Rights Reserved.
     2  //
     3  // This Source Code Form is subject to the terms of the MIT License.
     4  // If a copy of the MIT was not distributed with this file,
     5  // You can obtain one at https://github.com/gogf/gf.
     6  
     7  package gstructs
     8  
     9  // Signature returns a unique string as this type.
    10  func (t Type) Signature() string {
    11  	return t.PkgPath() + "/" + t.String()
    12  }
    13  
    14  // FieldKeys returns the keys of current struct/map.
    15  func (t Type) FieldKeys() []string {
    16  	keys := make([]string, t.NumField())
    17  	for i := 0; i < t.NumField(); i++ {
    18  		keys[i] = t.Field(i).Name
    19  	}
    20  	return keys
    21  }