Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit eba73e2

Browse filesBrowse files
committed
make retreiver unexported
1 parent c2429c5 commit eba73e2
Copy full SHA for eba73e2

File tree

Expand file treeCollapse file tree

1 file changed

+7
-7
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+7
-7
lines changed

‎retrieve.go

Copy file name to clipboardExpand all lines: retrieve.go
+7-7Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,20 +21,20 @@ func GetOrElse(v interface{}, def interface{}) interface{} {
2121
return val.Elem().Interface()
2222
}
2323

24-
type RetrieverOption func(retriever *Retriever)
24+
type RetrieverOption func(retriever *retriever)
2525

2626
func WithAllowZero() RetrieverOption {
27-
return func(r *Retriever) {
27+
return func(r *retriever) {
2828
r.AllowZero = true
2929
}
3030
}
3131

32-
type Retriever struct {
32+
type retriever struct {
3333
AllowZero bool
3434
}
3535

36-
func newRetriever(opts ...RetrieverOption) *Retriever {
37-
r := &Retriever{
36+
func newRetriever(opts ...RetrieverOption) *retriever {
37+
r := &retriever{
3838
AllowZero: false,
3939
}
4040
for _, opt := range opts {
@@ -45,7 +45,7 @@ func newRetriever(opts ...RetrieverOption) *Retriever {
4545
}
4646

4747
// Get retrieves the value at path of struct(s).
48-
func (r Retriever) Get(out interface{}, path string) interface{} {
48+
func (r retriever) Get(out interface{}, path string) interface{} {
4949
result := r.get(reflect.ValueOf(out), path)
5050
// valid kind and we can return a result.Interface() without panic
5151
if result.Kind() != reflect.Invalid && result.CanInterface() {
@@ -64,7 +64,7 @@ func (r Retriever) Get(out interface{}, path string) interface{} {
6464
return nil
6565
}
6666

67-
func (r Retriever) get(value reflect.Value, path string) reflect.Value {
67+
func (r retriever) get(value reflect.Value, path string) reflect.Value {
6868
if value.Kind() == reflect.Slice || value.Kind() == reflect.Array {
6969
var resultSlice reflect.Value
7070

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.