Skip to content

Commit 4d2b7b5

Browse files
committed
more fixes
Signed-off-by: Andrew Thornton <[email protected]>
1 parent 90a7bdc commit 4d2b7b5

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

modules/setting/storage.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ type Storage struct {
2121

2222
// MapTo implements the Mappable interface
2323
func (s *Storage) MapTo(v interface{}) error {
24-
pathValue := reflect.ValueOf(v).FieldByName("Path")
24+
pathValue := reflect.ValueOf(v).Elem().FieldByName("Path")
2525
if pathValue.IsValid() && pathValue.Kind() == reflect.String {
2626
pathValue.SetString(s.Path)
2727
}

modules/storage/storage.go

+4-4
Original file line numberDiff line numberDiff line change
@@ -143,24 +143,24 @@ func NewStorage(typStr string, cfg interface{}) (ObjectStorage, error) {
143143

144144
func initAvatars() (err error) {
145145
log.Info("Initialising Avatar storage with type: %s", setting.Avatar.Storage.Type)
146-
Avatars, err = NewStorage(setting.Avatar.Storage.Type, setting.Avatar.Storage)
146+
Avatars, err = NewStorage(setting.Avatar.Storage.Type, &setting.Avatar.Storage)
147147
return
148148
}
149149

150150
func initAttachments() (err error) {
151151
log.Info("Initialising Attachment storage with type: %s", setting.Attachment.Storage.Type)
152-
Attachments, err = NewStorage(setting.Attachment.Storage.Type, setting.Attachment.Storage)
152+
Attachments, err = NewStorage(setting.Attachment.Storage.Type, &setting.Attachment.Storage)
153153
return
154154
}
155155

156156
func initLFS() (err error) {
157157
log.Info("Initialising LFS storage with type: %s", setting.LFS.Storage.Type)
158-
LFS, err = NewStorage(setting.LFS.Storage.Type, setting.LFS.Storage)
158+
LFS, err = NewStorage(setting.LFS.Storage.Type, &setting.LFS.Storage)
159159
return
160160
}
161161

162162
func initRepoAvatars() (err error) {
163163
log.Info("Initialising Repository Avatar storage with type: %s", setting.RepoAvatar.Storage.Type)
164-
RepoAvatars, err = NewStorage(setting.RepoAvatar.Storage.Type, setting.RepoAvatar.Storage)
164+
RepoAvatars, err = NewStorage(setting.RepoAvatar.Storage.Type, &setting.RepoAvatar.Storage)
165165
return
166166
}

0 commit comments

Comments
 (0)