AddInstanceExt adds given extension(s), only if not already set returns true if added.
(ext ...string)
| 159 | // AddInstanceExt adds given extension(s), only if not already set |
| 160 | // returns true if added. |
| 161 | func (gp *GPU) AddInstanceExt(ext ...string) bool { |
| 162 | for _, ex := range ext { |
| 163 | i := FindString(ex, gp.InstanceExts) |
| 164 | if i >= 0 { |
| 165 | continue |
| 166 | } |
| 167 | gp.InstanceExts = append(gp.InstanceExts, ex) |
| 168 | } |
| 169 | return true |
| 170 | } |
| 171 | |
| 172 | // AddDeviceExt adds given extension(s), only if not already set |
| 173 | // returns true if added. |