Skip to content

Commit 23306ba

Browse files
committed
Added FQBN.StringWithoutConfig() method
1 parent 14d70bb commit 23306ba

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

arduino/cores/fqbn.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ func MustParseFQBN(fqbnIn string) *FQBN {
7575
}
7676

7777
func (fqbn *FQBN) String() string {
78-
res := fmt.Sprintf("%s:%s:%s", fqbn.Package, fqbn.PlatformArch, fqbn.BoardID)
78+
res := fqbn.StringWithoutConfig()
7979
if fqbn.Configs.Size() > 0 {
8080
sep := ":"
8181
for _, k := range fqbn.Configs.Keys() {
@@ -85,3 +85,8 @@ func (fqbn *FQBN) String() string {
8585
}
8686
return res
8787
}
88+
89+
// StringWithoutConfig returns the FQBN without the Config part
90+
func (fqbn *FQBN) StringWithoutConfig() string {
91+
return fqbn.Package + ":" + fqbn.PlatformArch + ":" + fqbn.BoardID
92+
}

0 commit comments

Comments
 (0)