示例#1
0
func (a *Assemblies) Delete(asmid string, removedAssemblys []string) {
	existingAssemblys := make([]string, len(a.AssemblysId))

	for i := 0; i < len(a.AssemblysId); i++ {
		if len(strings.TrimSpace(a.AssemblysId[i])) > 1 {
			existingAssemblys[i] = a.AssemblysId[i]
		}
	}
	if reflect.DeepEqual(existingAssemblys, removedAssemblys) {
		_ = db.Delete("assemblies", asmid)
	}
}
示例#2
0
func (c *Assembly) Delete(asmid string) {
	_ = db.Delete(ASSEMBLYBUCKET, asmid)
}