diff --git a/legacy/builder/gohasissues/go_has_issues.go b/legacy/builder/gohasissues/go_has_issues.go index 60c422ac018..4f24c62c0bf 100644 --- a/legacy/builder/gohasissues/go_has_issues.go +++ b/legacy/builder/gohasissues/go_has_issues.go @@ -34,8 +34,6 @@ import ( "os" "path/filepath" "sort" - "strconv" - "strings" ) func Walk(root string, walkFn filepath.WalkFunc) error { @@ -127,19 +125,3 @@ func resolveSymlink(parentFolder string, info os.FileInfo) (os.FileInfo, error) func isSymlink(info os.FileInfo) bool { return info.Mode()&os.ModeSymlink != 0 } - -func Unquote(s string) (string, error) { - if stringStartsEndsWith(s, "'") { - s = s[1 : len(s)-1] - } - - if !stringStartsEndsWith(s, "\"") { - return s, nil - } - - return strconv.Unquote(s) -} - -func stringStartsEndsWith(s string, c string) bool { - return strings.HasPrefix(s, c) && strings.HasSuffix(s, c) -} diff --git a/legacy/builder/test/unquote_test.go b/legacy/builder/test/unquote_test.go deleted file mode 100644 index 279e21e0a82..00000000000 --- a/legacy/builder/test/unquote_test.go +++ /dev/null @@ -1,54 +0,0 @@ -/* - * This file is part of Arduino Builder. - * - * Arduino Builder is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * As a special exception, you may use this file as part of a free software - * library without restriction. Specifically, if other files instantiate - * templates or use macros or inline functions from this file, or you compile - * this file and link it with other files to produce an executable, this - * file does not by itself cause the resulting executable to be covered by - * the GNU General Public License. This exception does not however - * invalidate any other reasons why the executable file might be covered by - * the GNU General Public License. - * - * Copyright 2015 Arduino LLC (http://www.arduino.cc/) - */ - -package test - -import ( - "github.com/arduino/arduino-cli/legacy/builder/gohasissues" - "github.com/stretchr/testify/require" - "testing" -) - -func TestStrConvUnquote(t *testing.T) { - s, err := gohasissues.Unquote("ciao") - NoError(t, err) - require.Equal(t, "ciao", s) - - s, err = gohasissues.Unquote("arduino:avr:uno") - NoError(t, err) - require.Equal(t, "arduino:avr:uno", s) - - s, err = gohasissues.Unquote("\"arduino:avr:uno\"") - NoError(t, err) - require.Equal(t, "arduino:avr:uno", s) - - s, err = gohasissues.Unquote("'arduino:avr:uno'") - NoError(t, err) - require.Equal(t, "arduino:avr:uno", s) -}