-
Notifications
You must be signed in to change notification settings - Fork 4
/
export_test.go
31 lines (25 loc) · 939 Bytes
/
export_test.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
package database
import (
"context"
"github.com/canonical/ubuntu-pro-for-windows/windows-agent/internal/distros/distro"
)
type SerializableDistro = serializableDistro
// NewDistro is a wrapper around newDistro so as to make it accessible to tests.
func (in SerializableDistro) NewDistro(ctx context.Context, storageDir string) (*distro.Distro, error) {
return in.newDistro(ctx, storageDir)
}
// NewSerializableDistro is a wrapper around newSerializableDistro so as to make it accessible to tests.
//
// unexported-return false positive! SerializableDistro is exported, even if it is an alias to an unexported type.
//
//nolint:revive
func NewSerializableDistro(d *distro.Distro) SerializableDistro {
return newSerializableDistro(d)
}
// DistroNames returns the names of all distros in the database.
func (db *DistroDB) DistroNames() (out []string) {
for _, d := range db.distros {
out = append(out, d.Name())
}
return out
}