Skip to content
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
53 lines (43 sloc) 1.39 KB
// Copyright 2017 gf Author( All Rights Reserved.
// This Source Code Form is subject to the terms of the MIT License.
// If a copy of the MIT was not distributed with this file,
// You can obtain one at
package g
import (
// NewVar returns a *gvar.Var.
func NewVar(i interface{}, unsafe ...bool) *Var {
return gvar.New(i, unsafe...)
// Wait blocks until all the web servers shutdown.
func Wait() {
// Dump dumps a variable to stdout with more manually readable.
func Dump(i ...interface{}) {
// Export exports a variable to string with more manually readable.
func Export(i ...interface{}) string {
return gutil.Export(i...)
// Throw throws a exception, which can be caught by TryCatch function.
// It always be used in TryCatch function.
func Throw(exception interface{}) {
// TryCatch does the try...catch... mechanism.
func TryCatch(try func(), catch ...func(exception interface{})) {
gutil.TryCatch(try, catch...)
// IsEmpty checks given value empty or not.
// It returns false if value is: integer(0), bool(false), slice/map(len=0), nil;
// or else true.
func IsEmpty(value interface{}) bool {
return empty.IsEmpty(value)
You can’t perform that action at this time.