mirror of
https://github.com/aptly-dev/aptly.git
synced 2026-05-06 22:18:28 +00:00
More Go linters enabled, issues fixed
Ref: #528 Enables "staticcheck", "varcheck", "structcheck", "aligncheck"
This commit is contained in:
+9
-13
@@ -45,8 +45,6 @@ type PublishedRepo struct {
|
||||
Architectures []string
|
||||
// SourceKind is "local"/"repo"
|
||||
SourceKind string
|
||||
// Skip contents generation
|
||||
SkipContents bool
|
||||
|
||||
// Map of sources by each component: component name -> source UUID
|
||||
Sources map[string]string
|
||||
@@ -55,10 +53,12 @@ type PublishedRepo struct {
|
||||
Component string
|
||||
// SourceUUID is UUID of either snapshot or local repo
|
||||
SourceUUID string `codec:"SnapshotUUID"`
|
||||
|
||||
// Map of component to source items
|
||||
sourceItems map[string]repoSourceItem
|
||||
|
||||
// Skip contents generation
|
||||
SkipContents bool
|
||||
|
||||
// True if repo is being re-published
|
||||
rePublishing bool
|
||||
}
|
||||
@@ -166,23 +166,19 @@ func NewPublishedRepo(storage, prefix, distribution string, architectures []stri
|
||||
component string
|
||||
snapshot *Snapshot
|
||||
localRepo *LocalRepo
|
||||
ok bool
|
||||
)
|
||||
|
||||
// get first source
|
||||
source = sources[0]
|
||||
|
||||
// figure out source kind
|
||||
snapshot, ok = source.(*Snapshot)
|
||||
if ok {
|
||||
switch source.(type) {
|
||||
case *Snapshot:
|
||||
result.SourceKind = "snapshot"
|
||||
} else {
|
||||
localRepo, ok = source.(*LocalRepo)
|
||||
if ok {
|
||||
result.SourceKind = "local"
|
||||
} else {
|
||||
panic("unknown source kind")
|
||||
}
|
||||
case *LocalRepo:
|
||||
result.SourceKind = "local"
|
||||
default:
|
||||
panic("unknown source kind")
|
||||
}
|
||||
|
||||
for i := range sources {
|
||||
|
||||
Reference in New Issue
Block a user