github.com/gogf/gf/v2@v2.7.4/os/gview/gview_error.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 gview
     8  
     9  import (
    10  	"github.com/gogf/gf/v2/os/gcmd"
    11  )
    12  
    13  const (
    14  	// commandEnvKeyForErrorPrint is used to specify the key controlling error printing to stdout.
    15  	// This error is designed not to be returned by functions.
    16  	commandEnvKeyForErrorPrint = "gf.gview.errorprint"
    17  )
    18  
    19  // errorPrint checks whether printing error to stdout.
    20  func errorPrint() bool {
    21  	return gcmd.GetOptWithEnv(commandEnvKeyForErrorPrint, true).Bool()
    22  }