github.com/blend/go-sdk@v1.20220411.3/env/is_dev.go (about)

     1  /*
     2  
     3  Copyright (c) 2022 - Present. Blend Labs, Inc. All rights reserved
     4  Use of this source code is governed by a MIT license that can be found in the LICENSE file.
     5  
     6  */
     7  
     8  package env
     9  
    10  // IsDev returns if the environment is development.
    11  func IsDev(serviceEnv string) bool {
    12  	switch serviceEnv {
    13  	case ServiceEnvDev:
    14  		return true
    15  	default:
    16  		return false
    17  	}
    18  }
    19  
    20  // IsDevTest returns if the environment is a local development environment (i.e. `dev` or `test`).
    21  func IsDevTest(serviceEnv string) bool {
    22  	switch serviceEnv {
    23  	case ServiceEnvDev, ServiceEnvTest:
    24  		return true
    25  	default:
    26  		return false
    27  	}
    28  }
    29  
    30  // IsDevlike returns if the environment is development.
    31  // It is strictly the inverse of `IsProdlike`.
    32  func IsDevlike(serviceEnv string) bool {
    33  	return !IsProdlike(serviceEnv)
    34  }