github.com/gogf/gf/v2@v2.7.4/os/genv/genv_must.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 genv
     8  
     9  // MustSet performs as Set, but it panics if any error occurs.
    10  func MustSet(key, value string) {
    11  	if err := Set(key, value); err != nil {
    12  		panic(err)
    13  	}
    14  }
    15  
    16  // MustRemove performs as Remove, but it panics if any error occurs.
    17  func MustRemove(key ...string) {
    18  	if err := Remove(key...); err != nil {
    19  		panic(err)
    20  	}
    21  }