(messageFormat string)
| 116 | var messageFormatArgument = regexp.MustCompile(`\{[\s]*([a-z0-9_]+)`) |
| 117 | |
| 118 | func messageFormatArguments(messageFormat string) (args []string) { |
| 119 | for _, matches := range messageFormatArgument.FindAllStringSubmatch(messageFormat, -1) { |
| 120 | if len(matches) == 2 { |
| 121 | args = append(args, matches[1]) |
| 122 | } |
| 123 | } |
| 124 | unique := make([]string, 0, len(args)) |
| 125 | seen := make(map[string]struct{}, len(args)) |
| 126 | for _, arg := range args { |
| 127 | if _, ok := seen[arg]; !ok { |
| 128 | unique = append(unique, arg) |
| 129 | seen[arg] = struct{}{} |
| 130 | } |
| 131 | } |
| 132 | return unique |
| 133 | } |
| 134 | |
| 135 | func define(code uint32, name, messageFormat string, publicAttributes ...string) *Definition { |
| 136 | ns := namespace(3) |
no outgoing calls
no test coverage detected