"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "vendor/github.com/spf13/pflag/bool_slice.go" between
buildah-1.11.2.tar.gz and buildah-1.11.3.tar.gz

About: Buildah is a tool that facilitates building Open Container Initiative (OCI) container images.

bool_slice.go  (buildah-1.11.2):bool_slice.go  (buildah-1.11.3)
skipping to change at line 74 skipping to change at line 74
boolStrSlice := make([]string, len(*s.value)) boolStrSlice := make([]string, len(*s.value))
for i, b := range *s.value { for i, b := range *s.value {
boolStrSlice[i] = strconv.FormatBool(b) boolStrSlice[i] = strconv.FormatBool(b)
} }
out, _ := writeAsCSV(boolStrSlice) out, _ := writeAsCSV(boolStrSlice)
return "[" + out + "]" return "[" + out + "]"
} }
func (s *boolSliceValue) fromString(val string) (bool, error) {
return strconv.ParseBool(val)
}
func (s *boolSliceValue) toString(val bool) string {
return strconv.FormatBool(val)
}
func (s *boolSliceValue) Append(val string) error {
i, err := s.fromString(val)
if err != nil {
return err
}
*s.value = append(*s.value, i)
return nil
}
func (s *boolSliceValue) Replace(val []string) error {
out := make([]bool, len(val))
for i, d := range val {
var err error
out[i], err = s.fromString(d)
if err != nil {
return err
}
}
*s.value = out
return nil
}
func (s *boolSliceValue) GetSlice() []string {
out := make([]string, len(*s.value))
for i, d := range *s.value {
out[i] = s.toString(d)
}
return out
}
func boolSliceConv(val string) (interface{}, error) { func boolSliceConv(val string) (interface{}, error) {
val = strings.Trim(val, "[]") val = strings.Trim(val, "[]")
// Empty string would cause a slice with one (empty) entry // Empty string would cause a slice with one (empty) entry
if len(val) == 0 { if len(val) == 0 {
return []bool{}, nil return []bool{}, nil
} }
ss := strings.Split(val, ",") ss := strings.Split(val, ",")
out := make([]bool, len(ss)) out := make([]bool, len(ss))
for i, t := range ss { for i, t := range ss {
var err error var err error
 End of changes. 1 change blocks. 
0 lines changed or deleted 38 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)