Skip to content

Commit d989619

Browse files
committed
make the IndexReasource a pointer so that it can be shared
1 parent 1ff9f25 commit d989619

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

index/index.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ var publicKeyHex string = "99020D0452FAA2FA011000D0C5604932111750628F171E4E612D5
4242

4343
// Init will initialize the IndexResource structure and will return it.
4444
// It will take indexString as a paramenter.
45-
func Init(indexString string, directory *paths.Path) IndexResource {
45+
func Init(indexString string, directory *paths.Path) *IndexResource {
4646
if directory == nil {
4747
log.Fatalf("configuration directory not provided")
4848
}
@@ -77,7 +77,7 @@ func Init(indexString string, directory *paths.Path) IndexResource {
7777
}
7878
}
7979

80-
return ir
80+
return &ir
8181
}
8282

8383
// DownloadAndVerify will download an index file located at IndexURL and verify the signature

main.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ var homeTemplateHTML string
9999
var (
100100
Tools tools.Tools
101101
Systray systray.Systray
102-
Index index.IndexResource
102+
Index *index.IndexResource
103103
)
104104

105105
type logWriter struct{}

tools/tools.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ import (
4848
// Tools will represent the installed tools
4949
type Tools struct {
5050
Directory string
51-
Index index.IndexResource
51+
Index *index.IndexResource
5252
Logger func(msg string)
5353
installed map[string]string
5454
mutex sync.RWMutex

0 commit comments

Comments
 (0)