Set must have pointer receiver so it doesn't change the value of a copy
(v string)
| 19 | |
| 20 | // Set must have pointer receiver so it doesn't change the value of a copy |
| 21 | func (e *Language) Set(v string) error { |
| 22 | switch v { |
| 23 | case "go", "java", "python", "javascript": |
| 24 | *e = Language(v) |
| 25 | return nil |
| 26 | default: |
| 27 | return errors.New(`must be one of "go", "java", "python" or "javascript"`) |
| 28 | } |
| 29 | } |
| 30 | |
| 31 | // Type is only used in help text |
| 32 | func (e *Language) Type() string { |