code.cloudfoundry.org/cli@v7.1.0+incompatible/cf/models/environment_variable.go (about)

     1  package models
     2  
     3  import "strings"
     4  
     5  type EnvironmentVariable struct {
     6  	Name  string
     7  	Value string
     8  }
     9  
    10  type EnvironmentVariableList []EnvironmentVariable
    11  
    12  func (evl EnvironmentVariableList) Len() int {
    13  	return len(evl)
    14  }
    15  
    16  func (evl EnvironmentVariableList) Swap(i, j int) {
    17  	evl[i], evl[j] = evl[j], evl[i]
    18  }
    19  
    20  func (evl EnvironmentVariableList) Less(i, j int) bool {
    21  	return strings.Compare(strings.ToLower(evl[i].Name), strings.ToLower(evl[j].Name)) == -1
    22  }