fixes
This commit is contained in:
parent
e6af7a73d5
commit
9258f3ed06
5 changed files with 8 additions and 8 deletions
|
|
@ -71,7 +71,7 @@ func MoveFile(src, dst string) error {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("failed to copy file: %v", err)
|
return fmt.Errorf("failed to copy file: %v", err)
|
||||||
}
|
}
|
||||||
// Disconnect the source file.
|
// Remove the source file.
|
||||||
err = os.Remove(src)
|
err = os.Remove(src)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("failed to remove source file: %v", err)
|
return fmt.Errorf("failed to remove source file: %v", err)
|
||||||
|
|
|
||||||
|
|
@ -53,7 +53,7 @@ func sliceCommonPrefix(dir1, dir2 string) string {
|
||||||
slicedDir1 := strings.TrimPrefix(dir1, commonPrefix)
|
slicedDir1 := strings.TrimPrefix(dir1, commonPrefix)
|
||||||
slicedDir2 := strings.TrimPrefix(dir2, commonPrefix)
|
slicedDir2 := strings.TrimPrefix(dir2, commonPrefix)
|
||||||
|
|
||||||
// Disconnect leading slashes
|
// Remove leading slashes
|
||||||
slicedDir1 = strings.TrimPrefix(slicedDir1, string(filepath.Separator))
|
slicedDir1 = strings.TrimPrefix(slicedDir1, string(filepath.Separator))
|
||||||
slicedDir2 = strings.TrimPrefix(slicedDir2, string(filepath.Separator))
|
slicedDir2 = strings.TrimPrefix(slicedDir2, string(filepath.Separator))
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -68,10 +68,10 @@ func (om *OrderedMap[K, V]) Values() []V {
|
||||||
// Delete removes a key-value pair from the OrderedMap.
|
// Delete removes a key-value pair from the OrderedMap.
|
||||||
func (om *OrderedMap[K, V]) Delete(key K) {
|
func (om *OrderedMap[K, V]) Delete(key K) {
|
||||||
if _, exists := om.values[key]; exists {
|
if _, exists := om.values[key]; exists {
|
||||||
// Disconnect the key from the map
|
// Remove the key from the map
|
||||||
delete(om.values, key)
|
delete(om.values, key)
|
||||||
|
|
||||||
// Disconnect the key from the keys slice
|
// Remove the key from the keys slice
|
||||||
for i, k := range om.keys {
|
for i, k := range om.keys {
|
||||||
if k == key {
|
if k == key {
|
||||||
om.keys = append(om.keys[:i], om.keys[i+1:]...)
|
om.keys = append(om.keys[:i], om.keys[i+1:]...)
|
||||||
|
|
|
||||||
|
|
@ -70,10 +70,10 @@ func (om *OrderedMap[K, V]) Values() []V {
|
||||||
// Delete removes a key-value pair from the OrderedMap.
|
// Delete removes a key-value pair from the OrderedMap.
|
||||||
func (om *OrderedMap[K, V]) Delete(key K) {
|
func (om *OrderedMap[K, V]) Delete(key K) {
|
||||||
if _, exists := om.values[key]; exists {
|
if _, exists := om.values[key]; exists {
|
||||||
// Disconnect the key from the map
|
// Remove the key from the map
|
||||||
delete(om.values, key)
|
delete(om.values, key)
|
||||||
|
|
||||||
// Disconnect the key from the keys slice
|
// Remove the key from the keys slice
|
||||||
for i, k := range om.keys {
|
for i, k := range om.keys {
|
||||||
if k == key {
|
if k == key {
|
||||||
om.keys = append(om.keys[:i], om.keys[i+1:]...)
|
om.keys = append(om.keys[:i], om.keys[i+1:]...)
|
||||||
|
|
|
||||||
|
|
@ -64,10 +64,10 @@ func (om *OrderedMap[K, V]) Values() []V {
|
||||||
// Delete removes a key-value pair from the OrderedMap.
|
// Delete removes a key-value pair from the OrderedMap.
|
||||||
func (om *OrderedMap[K, V]) Delete(key K) {
|
func (om *OrderedMap[K, V]) Delete(key K) {
|
||||||
if _, exists := om.values[key]; exists {
|
if _, exists := om.values[key]; exists {
|
||||||
// Disconnect the key from the map
|
// Remove the key from the map
|
||||||
delete(om.values, key)
|
delete(om.values, key)
|
||||||
|
|
||||||
// Disconnect the key from the keys slice
|
// Remove the key from the keys slice
|
||||||
for i, k := range om.keys {
|
for i, k := range om.keys {
|
||||||
if k == key {
|
if k == key {
|
||||||
om.keys = append(om.keys[:i], om.keys[i+1:]...)
|
om.keys = append(om.keys[:i], om.keys[i+1:]...)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue