Skip to main content
Version: 2.8.x(Latest)

Introduction

gvar is a runtime generic implementation that enhances development convenience and efficiency with minimal runtime overhead. It supports various built-in data type conversions and can be used as an alternative to the interface{} type. This type supports concurrency safety toggles.

tip

The framework also provides the g.Var data type, which is essentially an alias for the gvar.Var data type.

Usage Scenarios:

Scenarios where interface{} is used, various data formats that are not fixed, or scenarios that require frequent data type conversion.

Usage:

import "github.com/gogf/gf/v2/container/gvar"

Interface Documentation:

https://pkg.go.dev/github.com/gogf/gf/v2/container/gvar

Documents