addBaseProfiles adds the list of base profiles or diff base profiles to the source. This function will return an error if both base and diff base profiles are specified.
(flagBase, flagDiffBase []*string)
| 172 | // the source. This function will return an error if both base and diff base |
| 173 | // profiles are specified. |
| 174 | func (source *source) addBaseProfiles(flagBase, flagDiffBase []*string) error { |
| 175 | base, diffBase := dropEmpty(flagBase), dropEmpty(flagDiffBase) |
| 176 | if len(base) > 0 && len(diffBase) > 0 { |
| 177 | return errors.New("-base and -diff_base flags cannot both be specified") |
| 178 | } |
| 179 | |
| 180 | source.Base = base |
| 181 | if len(diffBase) > 0 { |
| 182 | source.Base, source.DiffBase = diffBase, true |
| 183 | } |
| 184 | return nil |
| 185 | } |
| 186 | |
| 187 | // dropEmpty list takes a slice of string pointers, and outputs a slice of |
| 188 | // non-empty strings associated with the flag. |
no test coverage detected