Skip to content
This repository has been archived by the owner on May 1, 2023. It is now read-only.

Commit

Permalink
Fix golint warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
harryzcy committed Apr 1, 2021
1 parent 39309ae commit bdfa6fe
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 4 deletions.
1 change: 1 addition & 0 deletions internal/localcheck/arch.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"strings"
)

// Architectures represents all supported architecture of an app
type Architectures struct {
Intel uint
Arm uint
Expand Down
8 changes: 4 additions & 4 deletions internal/localcheck/local.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,10 +103,10 @@ func getInterpreterPath(filename string) (path string, ok bool) {
return "", false
}

return path, true
} else {
path := strings.SplitN(line, " ", 2)[0]

return path, true
}

path = strings.SplitN(line, " ", 2)[0]

return path, true
}
1 change: 1 addition & 0 deletions internal/macapp/macapp.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ func init() {
}
}

// Application represents an installed app
type Application struct {
// Name shows the app name
Name string
Expand Down
2 changes: 2 additions & 0 deletions internal/remotecheck/remote.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ var (
infoCache map[string]AppInfo = make(map[string]AppInfo)
)

// AppInfo represents the basic information of an app obtained from remote sources
type AppInfo struct {
Website string
ArmSupport Support
Expand Down Expand Up @@ -48,6 +49,7 @@ func Init() error {
return nil
}

// GetInfo returns the info of an app from remote sources
func GetInfo(name string) (AppInfo, error) {
if info, ok := infoCache[name]; ok {
return info, nil
Expand Down
8 changes: 8 additions & 0 deletions internal/remotecheck/support.go
Original file line number Diff line number Diff line change
@@ -1,16 +1,24 @@
package remotecheck

// Support represents the Arm support status of an app
type Support uint

const (
// SupportUndefined is the zero value of Support type
SupportUndefined Support = iota // zero value
// SupportNative means an app have native Apple Silicon support
SupportNative
// SupportTransition means an app is supported vis Rosetta 2 or Virtual Environment
SupportTransition
// SupportInDevelopment means an app does not support Apple Silicon yet but the support is in development
SupportInDevelopment
// SupportInDevelopment means an app does not support Apple Silicon
SupportNotYet
// SupportUnknown means it's not known if an app supports Apple Silicon
SupportUnknown
)

// Parse parses support information from string.
func (s *Support) Parse(str string) Support {
switch str {
case "✅":
Expand Down

0 comments on commit bdfa6fe

Please sign in to comment.