diff --git a/profile/api.go b/profile/api.go index 51f877da..1a69a4e4 100644 --- a/profile/api.go +++ b/profile/api.go @@ -116,6 +116,7 @@ type updateProfileIconResponse struct { Filename string `json:"filename"` } +//nolint:goconst func handleUpdateProfileIcon(ar *api.Request) (any, error) { // Check input. if len(ar.InputData) == 0 { diff --git a/profile/config.go b/profile/config.go index d65f10bd..fdfcd330 100644 --- a/profile/config.go +++ b/profile/config.go @@ -672,7 +672,7 @@ Current Features: - Disable Firefox' internal DNS-over-HTTPs resolver - Block direct access to public DNS resolvers -Please note that DNS bypass attempts might be additionally blocked in the Sytem D there too.`, +Please note that DNS bypass attempts might be additionally blocked in the System DNS Client App.`, OptType: config.OptTypeInt, ExpertiseLevel: config.ExpertiseLevelUser, ReleaseLevel: config.ReleaseLevelStable, diff --git a/profile/fingerprint.go b/profile/fingerprint.go index 9caf8794..56e92172 100644 --- a/profile/fingerprint.go +++ b/profile/fingerprint.go @@ -163,7 +163,8 @@ func (fp fingerprintRegex) Match(value string) (score int) { return 0 } -type parsedFingerprints struct { +// ParsedFingerprints holds parsed fingerprints for fast usage. +type ParsedFingerprints struct { tagPrints []matchingFingerprint envPrints []matchingFingerprint pathPrints []matchingFingerprint @@ -171,8 +172,8 @@ type parsedFingerprints struct { } // ParseFingerprints parses the fingerprints to make them ready for matching. -func ParseFingerprints(raw []Fingerprint, deprecatedLinkedPath string) (parsed *parsedFingerprints, firstErr error) { - parsed = &parsedFingerprints{} +func ParseFingerprints(raw []Fingerprint, deprecatedLinkedPath string) (parsed *ParsedFingerprints, firstErr error) { + parsed = &ParsedFingerprints{} // Add deprecated LinkedPath to fingerprints, if they are empty. // TODO: Remove in v1.5 @@ -239,7 +240,7 @@ func ParseFingerprints(raw []Fingerprint, deprecatedLinkedPath string) (parsed * return parsed, firstErr } -func (parsed *parsedFingerprints) addMatchingFingerprint(fp Fingerprint, matchingPrint matchingFingerprint) { +func (parsed *ParsedFingerprints) addMatchingFingerprint(fp Fingerprint, matchingPrint matchingFingerprint) { switch fp.Type { case FingerprintTypeTagID: parsed.tagPrints = append(parsed.tagPrints, matchingPrint) @@ -257,7 +258,7 @@ func (parsed *parsedFingerprints) addMatchingFingerprint(fp Fingerprint, matchin // MatchFingerprints returns the highest matching score of the given // fingerprints and matching data. -func MatchFingerprints(prints *parsedFingerprints, md MatchingData) (highestScore int) { +func MatchFingerprints(prints *ParsedFingerprints, md MatchingData) (highestScore int) { // Check tags. tags := md.Tags() if len(tags) > 0 { diff --git a/profile/get.go b/profile/get.go index 2a5424cf..3fcf78e5 100644 --- a/profile/get.go +++ b/profile/get.go @@ -257,7 +257,7 @@ profileFeed: return profile, nil } -func loadProfileFingerprints(r record.Record) (parsed *parsedFingerprints, err error) { +func loadProfileFingerprints(r record.Record) (parsed *ParsedFingerprints, err error) { // Ensure it's a profile. profile, err := EnsureProfile(r) if err != nil { diff --git a/profile/icon.go b/profile/icon.go index 96e2f3f0..fe5f5c72 100644 --- a/profile/icon.go +++ b/profile/icon.go @@ -103,6 +103,7 @@ var iconDB = database.NewInterface(&database.Options{ Internal: true, }) +// IconInDatabase represents an icon saved to the database. type IconInDatabase struct { sync.Mutex record.Base diff --git a/profile/profile.go b/profile/profile.go index 87228acb..8cdb2f58 100644 --- a/profile/profile.go +++ b/profile/profile.go @@ -21,7 +21,7 @@ import ( ) // ProfileSource is the source of the profile. -type ProfileSource string +type ProfileSource string //nolint:golint // Profile Sources. const ( diff --git a/sync/profile.go b/sync/profile.go index 78112658..c6e936d5 100644 --- a/sync/profile.go +++ b/sync/profile.go @@ -8,11 +8,12 @@ import ( "strings" "time" + "github.com/vincent-petithory/dataurl" + "github.com/safing/portbase/api" "github.com/safing/portbase/config" "github.com/safing/portbase/log" "github.com/safing/portmaster/profile" - "github.com/vincent-petithory/dataurl" ) // ProfileExport holds an export of a profile.