File tree 2 files changed +12
-5
lines changed
2 files changed +12
-5
lines changed Original file line number Diff line number Diff line change @@ -148,9 +148,8 @@ func (a *Attest) UnmarshalText(text []byte) error {
148
148
if ! ok {
149
149
return errors .Errorf ("invalid value %s" , field )
150
150
}
151
- key = strings .TrimSpace (strings .ToLower (key ))
152
151
153
- switch key {
152
+ switch strings . TrimSpace ( strings . ToLower ( key )) {
154
153
case "type" :
155
154
a .Type = value
156
155
case "disabled" :
Original file line number Diff line number Diff line change 1
1
package buildflags
2
2
3
3
import (
4
+ "encoding/csv"
4
5
"encoding/json"
5
6
"maps"
6
7
"regexp"
@@ -259,9 +260,16 @@ func (w *csvBuilder) Write(key, value string) {
259
260
if w .sb .Len () > 0 {
260
261
w .sb .WriteByte (',' )
261
262
}
262
- w .sb .WriteString (key )
263
- w .sb .WriteByte ('=' )
264
- w .sb .WriteString (value )
263
+
264
+ var attr strings.Builder
265
+ writer := csv .NewWriter (& attr )
266
+
267
+ writer .Write ([]string {
268
+ key + "=" + value ,
269
+ })
270
+ writer .Flush ()
271
+
272
+ w .sb .WriteString (strings .TrimSpace (attr .String ()))
265
273
}
266
274
267
275
func (w * csvBuilder ) WriteAttributes (attrs map [string ]string ) {
You can’t perform that action at this time.
0 commit comments