Skip to content

[skip changelog] Small cleanups #688

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
May 7, 2020
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Added FQBN.StringWithoutConfig() method
  • Loading branch information
cmaglie committed May 7, 2020
commit 2a15bbaf8254d10c8882a18ab5eb6db28134f38a
7 changes: 6 additions & 1 deletion arduino/cores/fqbn.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ func ParseFQBN(fqbnIn string) (*FQBN, error) {
}

func (fqbn *FQBN) String() string {
res := fmt.Sprintf("%s:%s:%s", fqbn.Package, fqbn.PlatformArch, fqbn.BoardID)
res := fqbn.StringWithoutConfig()
if fqbn.Configs.Size() > 0 {
sep := ":"
for _, k := range fqbn.Configs.Keys() {
Expand All @@ -75,3 +75,8 @@ func (fqbn *FQBN) String() string {
}
return res
}

// StringWithoutConfig returns the FQBN without the Config part
func (fqbn *FQBN) StringWithoutConfig() string {
return fqbn.Package + ":" + fqbn.PlatformArch + ":" + fqbn.BoardID
}