Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
arduino-cli
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Operations
Operations
Metrics
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
xpstem
arduino-cli
Commits
d94fe6c2
Unverified
Commit
d94fe6c2
authored
Sep 13, 2019
by
Cristian Maglie
Committed by
GitHub
Sep 13, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Removed functions for command line mangling (#400)
parent
94e7e7aa
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
0 additions
and
72 deletions
+0
-72
legacy/builder/gohasissues/go_has_issues.go
legacy/builder/gohasissues/go_has_issues.go
+0
-18
legacy/builder/test/unquote_test.go
legacy/builder/test/unquote_test.go
+0
-54
No files found.
legacy/builder/gohasissues/go_has_issues.go
View file @
d94fe6c2
...
...
@@ -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
)
}
legacy/builder/test/unquote_test.go
deleted
100644 → 0
View file @
94e7e7aa
/*
* 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
)
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment