github.com/blend/go-sdk@v1.20220411.3/sourceutil/remove_quotes.go (about)

     1  /*
     2  
     3  Copyright (c) 2022 - Present. Blend Labs, Inc. All rights reserved
     4  Use of this source code is governed by a MIT license that can be found in the LICENSE file.
     5  
     6  */
     7  
     8  package sourceutil
     9  
    10  // RemoveQuotes removes quotes from a string
    11  func RemoveQuotes(value string) string {
    12  	var output []rune
    13  	for _, r := range value {
    14  		switch r {
    15  		case '"', '\'':
    16  			continue
    17  		default:
    18  			output = append(output, r)
    19  		}
    20  	}
    21  	return string(output)
    22  }