gvar_scan.go 671 B

12345678910111213141516171819
  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. package gvar
  7. import (
  8. "github.com/gogf/gf/v2/util/gconv"
  9. )
  10. // Scan automatically checks the type of `pointer` and converts `params` to `pointer`. It supports `pointer`
  11. // with type of `*map/*[]map/*[]*map/*struct/**struct/*[]struct/*[]*struct` for converting.
  12. //
  13. // See gconv.Scan.
  14. func (v *Var) Scan(pointer interface{}, mapping ...map[string]string) error {
  15. return gconv.Scan(v.Val(), pointer, mapping...)
  16. }