Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix function comments based on best practices from Effective Go #40

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions inject.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ func (inj *injector) Invoke(f interface{}) ([]reflect.Value, error) {
return reflect.ValueOf(f).Call(in), nil
}

// Maps dependencies in the Type map to each field in the struct
// Apply: Maps dependencies in the Type map to each field in the struct
// that is tagged with 'inject'.
// Returns an error if the injection fails.
func (inj *injector) Apply(val interface{}) error {
Expand Down Expand Up @@ -136,7 +136,7 @@ func (inj *injector) Apply(val interface{}) error {
return nil
}

// Maps the concrete value of val to its dynamic type using reflect.TypeOf,
// Map: Maps the concrete value of val to its dynamic type using reflect.TypeOf,
// It returns the TypeMapper registered in.
func (i *injector) Map(val interface{}) TypeMapper {
i.values[reflect.TypeOf(val)] = reflect.ValueOf(val)
Expand All @@ -148,7 +148,7 @@ func (i *injector) MapTo(val interface{}, ifacePtr interface{}) TypeMapper {
return i
}

// Maps the given reflect.Type to the given reflect.Value and returns
// Set: Maps the given reflect.Type to the given reflect.Value and returns
// the Typemapper the mapping has been registered in.
func (i *injector) Set(typ reflect.Type, val reflect.Value) TypeMapper {
i.values[typ] = val
Expand Down