mirror of
				https://gitea.com/Lydanne/buildx.git
				synced 2025-11-04 01:53:42 +08:00 
			
		
		
		
	use csvvalue package for parsing csv inputs
This package is better suited for parsing single-line CSV strings. Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
This commit is contained in:
		@@ -5,7 +5,6 @@ import (
 | 
			
		||||
	"context"
 | 
			
		||||
	"crypto/sha256"
 | 
			
		||||
	"encoding/base64"
 | 
			
		||||
	"encoding/csv"
 | 
			
		||||
	"encoding/hex"
 | 
			
		||||
	"encoding/json"
 | 
			
		||||
	"fmt"
 | 
			
		||||
@@ -59,6 +58,7 @@ import (
 | 
			
		||||
	"github.com/sirupsen/logrus"
 | 
			
		||||
	"github.com/spf13/cobra"
 | 
			
		||||
	"github.com/spf13/pflag"
 | 
			
		||||
	"github.com/tonistiigi/go-csvvalue"
 | 
			
		||||
	"go.opentelemetry.io/otel/attribute"
 | 
			
		||||
	"go.opentelemetry.io/otel/metric"
 | 
			
		||||
	"google.golang.org/grpc/codes"
 | 
			
		||||
@@ -982,9 +982,9 @@ func (cfg *invokeConfig) parseInvokeConfig(invoke, on string) error {
 | 
			
		||||
		return nil
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	csvReader := csv.NewReader(strings.NewReader(invoke))
 | 
			
		||||
	csvReader.LazyQuotes = true
 | 
			
		||||
	fields, err := csvReader.Read()
 | 
			
		||||
	csvParser := csvvalue.NewParser()
 | 
			
		||||
	csvParser.LazyQuotes = true
 | 
			
		||||
	fields, err := csvParser.Fields(invoke, nil)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return err
 | 
			
		||||
	}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user