Skip to content

Commit a2da084

Browse files
author
Luca Bianconi
committed
style: run go:format
1 parent 5bd2837 commit a2da084

File tree

5 files changed

+24
-7
lines changed

5 files changed

+24
-7
lines changed

arduino/cores/packageindex/index.go

+11
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,15 @@ import (
3030
)
3131

3232
// Index represents Cores and Tools struct as seen from package_index.json file.
33+
//
3334
//easyjson:json
3435
type Index struct {
3536
Packages []*indexPackage `json:"packages"`
3637
IsTrusted bool
3738
}
3839

3940
// indexPackage represents a single entry from package_index.json file.
41+
//
4042
//easyjson:json
4143
type indexPackage struct {
4244
Name string `json:"name"`
@@ -50,6 +52,7 @@ type indexPackage struct {
5052
}
5153

5254
// indexPlatformRelease represents a single Core Platform from package_index.json file.
55+
//
5356
//easyjson:json
5457
type indexPlatformRelease struct {
5558
Name string `json:"name"`
@@ -69,6 +72,7 @@ type indexPlatformRelease struct {
6972
}
7073

7174
// indexToolDependency represents a single dependency of a core from a tool.
75+
//
7276
//easyjson:json
7377
type indexToolDependency struct {
7478
Packager string `json:"packager"`
@@ -77,20 +81,23 @@ type indexToolDependency struct {
7781
}
7882

7983
// indexDiscoveryDependency represents a single dependency of a core from a pluggable discovery tool.
84+
//
8085
//easyjson:json
8186
type indexDiscoveryDependency struct {
8287
Packager string `json:"packager"`
8388
Name string `json:"name"`
8489
}
8590

8691
// indexMonitorDependency represents a single dependency of a core from a pluggable monitor tool.
92+
//
8793
//easyjson:json
8894
type indexMonitorDependency struct {
8995
Packager string `json:"packager"`
9096
Name string `json:"name"`
9197
}
9298

9399
// indexToolRelease represents a single Tool from package_index.json file.
100+
//
94101
//easyjson:json
95102
type indexToolRelease struct {
96103
Name string `json:"name"`
@@ -99,6 +106,7 @@ type indexToolRelease struct {
99106
}
100107

101108
// indexToolReleaseFlavour represents a single tool flavor in the package_index.json file.
109+
//
102110
//easyjson:json
103111
type indexToolReleaseFlavour struct {
104112
OS string `json:"host"`
@@ -109,19 +117,22 @@ type indexToolReleaseFlavour struct {
109117
}
110118

111119
// indexBoard represents a single Board as written in package_index.json file.
120+
//
112121
//easyjson:json
113122
type indexBoard struct {
114123
Name string `json:"name"`
115124
ID []indexBoardID `json:"id,omitempty"`
116125
}
117126

118127
// indexBoardID represents the ID of a single board. i.e. uno, yun, diecimila, micro and the likes
128+
//
119129
//easyjson:json
120130
type indexBoardID struct {
121131
USB string `json:"usb"`
122132
}
123133

124134
// indexHelp represents the help URL
135+
//
125136
//easyjson:json
126137
type indexHelp struct {
127138
Online string `json:"online,omitempty"`

arduino/security/signatures.go

+3-1
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,9 @@ func VerifyDetachedSignature(targetPath *paths.Path, signaturePath *paths.Path,
6464
// VerifySignature checks that the detached GPG signature (in the
6565
// signaturePath file) matches the given targetPath file and is an authentic
6666
// signature. This function allows to pass an io.Reader to read the custom key.
67-
// If any of the above conditions fails this function returns false.
67+
//
68+
// If any of the above conditions fails this function returns false.
69+
//
6870
// The PGP entity in the trusted keychain that produced the signature is returned too.
6971
func VerifySignature(targetPath *paths.Path, signaturePath *paths.Path, arduinoKeyringFile io.Reader) (bool, *openpgp.Entity, error) {
7072
keyRing, err := openpgp.ReadKeyRing(arduinoKeyringFile)

commands/daemon/settings.go

+5-2
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,12 @@ func (s *SettingsService) GetAll(ctx context.Context, req *rpc.GetAllRequest) (*
4646

4747
// mapper converts a map of nested maps to a map of scalar values.
4848
// For example:
49-
// {"foo": "bar", "daemon":{"port":"420"}, "sketch": {"always_export_binaries": "true"}}
49+
//
50+
// {"foo": "bar", "daemon":{"port":"420"}, "sketch": {"always_export_binaries": "true"}}
51+
//
5052
// would convert to:
51-
// {"foo": "bar", "daemon.port":"420", "sketch.always_export_binaries": "true"}
53+
//
54+
// {"foo": "bar", "daemon.port":"420", "sketch.always_export_binaries": "true"}
5255
func mapper(toMap map[string]interface{}) map[string]interface{} {
5356
res := map[string]interface{}{}
5457
for k, v := range toMap {

i18n/convert.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ var javaFormatPlaceholderRegexp = regexp.MustCompile(`{(\d)}`)
2626
// FromJavaToGoSyntax convert a translation string made for Java to a one suitable for golang (printf-style).
2727
// The conversion transforms java placeholders like "{0}","{1}","{2}",etc... with the equivalent for golang
2828
// "%[1]v","%[2]v","%[3]v",etc...
29-
// The double single-quote "''" is translated into a single single-quote "'".
29+
// A pair of adjacent single-quote characters "'" (U+0027) is replaced with one only.
3030
func FromJavaToGoSyntax(s string) string {
3131
// Replace "{x}" => "%[x+1]v"
3232
for _, submatch := range javaFormatPlaceholderRegexp.FindAllStringSubmatch(s, -1) {

version/version_test.go

+4-3
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,10 @@ import (
2323

2424
// TestBuildInjectedInfo tests the Info strings passed to the binary at build time
2525
// in order to have this test green launch your testing using the provided task (see /Taskfile.yml) or use:
26-
// go test -run TestBuildInjectedInfo -v ./... -ldflags '
27-
// -X github.com/arduino/arduino-cli/version.versionString=0.0.0-test.preview
28-
// -X github.com/arduino/arduino-cli/version.commit=deadbeef'
26+
//
27+
// go test -run TestBuildInjectedInfo -v ./... -ldflags '
28+
// -X github.com/arduino/arduino-cli/version.versionString=0.0.0-test.preview
29+
// -X github.com/arduino/arduino-cli/version.commit=deadbeef'
2930
func TestBuildInjectedInfo(t *testing.T) {
3031
goldenAppName := "arduino-cli"
3132
goldenInfo := Info{

0 commit comments

Comments
 (0)