github.com/blend/go-sdk@v1.20220411.3/env/split.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  // Split splits an env var in the form `KEY=value`.
    11  func Split(s string) (key, value string) {
    12  	for i := 0; i < len(s); i++ {
    13  		if s[i] == '=' {
    14  			key = s[:i]
    15  			value = s[i+1:]
    16  			return
    17  		}
    18  	}
    19  	return
    20  }