Skip to content

Commit

Permalink
docs: update README
Browse files Browse the repository at this point in the history
  • Loading branch information
wolfogre committed May 12, 2020
1 parent 9e13027 commit 244bb5a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,12 @@ type UserTags struct {
// Tags return specified tags of User
func (User) Tags(tag string, convert ...func(string) string) UserTags {
conv := func(in string) string { return strings.TrimSpace(strings.Split(in, ",")[0]) }
if len(convert) > 0 && convert[0] != nil {
if len(convert) > 0 {
conv = convert[0]
}
if conv == nil {
conv = func(in string) string { return in }
}
_ = conv
return UserTags{
Id: conv(tagOfUserId.Get(tag)),
Expand Down
5 changes: 4 additions & 1 deletion test/internal/tutorial/user_tag.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 244bb5a

Please sign in to comment.