gview_error.go 683 B

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