...

Source file src/gotest.tools/v3/assert/cmd/gty-migrate-from-testify/flags.go

Documentation: gotest.tools/v3/assert/cmd/gty-migrate-from-testify

     1  package main
     2  
     3  import (
     4  	"encoding/csv"
     5  	"strings"
     6  )
     7  
     8  type stringSliceValue []string
     9  
    10  func (s stringSliceValue) String() string {
    11  	return strings.Join(s, ", ")
    12  }
    13  
    14  func (s *stringSliceValue) Set(raw string) error {
    15  	if raw == "" {
    16  		return nil
    17  	}
    18  	v, err := csv.NewReader(strings.NewReader(raw)).Read()
    19  	if err != nil {
    20  		return err
    21  	}
    22  	*s = append(*s, v...)
    23  	return nil
    24  }
    25  

View as plain text