From 2499fd5310a8856752ca08899d15ca340266eae8 Mon Sep 17 00:00:00 2001
From: HowJMay <vulxj0j8j8@gmail.com>
Date: Mon, 20 Jan 2020 17:13:05 +0800
Subject: [PATCH] fix: Fix typo

---
 arduino/cores/packagemanager/loader.go | 18 +++++++++---------
 arduino/cores/status.go                |  8 ++++----
 cli/lib/search.go                      |  2 +-
 3 files changed, 14 insertions(+), 14 deletions(-)

diff --git a/arduino/cores/packagemanager/loader.go b/arduino/cores/packagemanager/loader.go
index 6328fc4c15c..771eef2e945 100644
--- a/arduino/cores/packagemanager/loader.go
+++ b/arduino/cores/packagemanager/loader.go
@@ -146,12 +146,12 @@ func (pm *PackageManager) loadPlatforms(targetPackage *cores.Package, packageDir
 	}
 
 	for _, file := range files {
-		architecure := file.Base()
-		if strings.HasPrefix(architecure, ".") || architecure == "tools" ||
-			architecure == "platform.txt" { // TODO: Check if this "platform.txt" condition should be here....
+		architecture := file.Base()
+		if strings.HasPrefix(architecture, ".") || architecture == "tools" ||
+			architecture == "platform.txt" { // TODO: Check if this "platform.txt" condition should be here....
 			continue
 		}
-		platformPath := packageDir.Join(architecure)
+		platformPath := packageDir.Join(architecture)
 		if !platformPath.IsDir() {
 			continue
 		}
@@ -197,16 +197,16 @@ func (pm *PackageManager) loadPlatforms(targetPackage *cores.Package, packageDir
 				index.MergeIntoPackages(tmp)
 				if tmpPackage := tmp.GetOrCreatePackage(targetPackage.Name); tmpPackage == nil {
 					pm.Log.Warnf("Can't determine bundle platform version for %s", targetPackage.Name)
-				} else if tmpPlatform := tmpPackage.GetOrCreatePlatform(architecure); tmpPlatform == nil {
-					pm.Log.Warnf("Can't determine bundle platform version for %s:%s", targetPackage.Name, architecure)
+				} else if tmpPlatform := tmpPackage.GetOrCreatePlatform(architecture); tmpPlatform == nil {
+					pm.Log.Warnf("Can't determine bundle platform version for %s:%s", targetPackage.Name, architecture)
 				} else if tmpPlatformRelease := tmpPlatform.GetLatestRelease(); tmpPlatformRelease == nil {
-					pm.Log.Warnf("Can't determine bundle platform version for %s:%s, no valid release found", targetPackage.Name, architecure)
+					pm.Log.Warnf("Can't determine bundle platform version for %s:%s, no valid release found", targetPackage.Name, architecture)
 				} else {
 					version = tmpPlatformRelease.Version
 				}
 			}
 
-			platform := targetPackage.GetOrCreatePlatform(architecure)
+			platform := targetPackage.GetOrCreatePlatform(architecture)
 			release, err := platform.GetOrCreateRelease(version)
 			if err != nil {
 				return fmt.Errorf("loading platform release: %s", err)
@@ -221,7 +221,7 @@ func (pm *PackageManager) loadPlatforms(targetPackage *cores.Package, packageDir
 			// case: ARCHITECTURE/VERSION/boards.txt
 			// let's dive into VERSION directories
 
-			platform := targetPackage.GetOrCreatePlatform(architecure)
+			platform := targetPackage.GetOrCreatePlatform(architecture)
 			versionDirs, err := platformPath.ReadDir()
 			if err != nil {
 				return fmt.Errorf("reading dir %s: %s", platformPath, err)
diff --git a/arduino/cores/status.go b/arduino/cores/status.go
index 9e7d8ce46f3..13f89eda90b 100644
--- a/arduino/cores/status.go
+++ b/arduino/cores/status.go
@@ -95,16 +95,16 @@ func (packages Packages) GetDepsOfPlatformRelease(release *PlatformRelease) ([]*
 
 // GetOrCreatePlatform returns the Platform object with the specified architecture
 // or creates a new one if not found
-func (targetPackage *Package) GetOrCreatePlatform(architecure string) *Platform {
-	if platform, ok := targetPackage.Platforms[architecure]; ok {
+func (targetPackage *Package) GetOrCreatePlatform(architecture string) *Platform {
+	if platform, ok := targetPackage.Platforms[architecture]; ok {
 		return platform
 	}
 	targetPlatform := &Platform{
-		Architecture: architecure,
+		Architecture: architecture,
 		Releases:     map[string]*PlatformRelease{},
 		Package:      targetPackage,
 	}
-	targetPackage.Platforms[architecure] = targetPlatform
+	targetPackage.Platforms[architecture] = targetPlatform
 	return targetPlatform
 }
 
diff --git a/cli/lib/search.go b/cli/lib/search.go
index c508c5a7992..bdd45fc67d0 100644
--- a/cli/lib/search.go
+++ b/cli/lib/search.go
@@ -35,7 +35,7 @@ import (
 func initSearchCommand() *cobra.Command {
 	searchCommand := &cobra.Command{
 		Use:     "search [LIBRARY_NAME]",
-		Short:   "Searchs for one or more libraries data.",
+		Short:   "Searches for one or more libraries data.",
 		Long:    "Search for one or more libraries data (case insensitive search).",
 		Example: "  " + os.Args[0] + " lib search audio",
 		Args:    cobra.ArbitraryArgs,