aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorn-peugnet <n.peugnet@free.fr>2021-10-15 12:03:44 +0200
committern-peugnet <n.peugnet@free.fr>2021-10-15 12:03:44 +0200
commit3ffafd6499f50ea71d1ad1a7ac554f4c4448ed6c (patch)
tree6caec73906e90cd3e4fbe6592868e979f7d4479e
parent5016267b78261b07ac24190584707bf2745160a8 (diff)
downloaddna-backup-3ffafd6499f50ea71d1ad1a7ac554f4c4448ed6c.tar.gz
dna-backup-3ffafd6499f50ea71d1ad1a7ac554f4c4448ed6c.zip
add copyright and license notice + remove dead code
-rw-r--r--Makefile17
-rw-r--r--cache/cache.go17
-rw-r--r--cache/cache_test.go17
-rw-r--r--delta/delta.go17
-rw-r--r--exp/Makefile17
-rwxr-xr-xexp/exp.sh17
-rw-r--r--logger/logger.go17
-rw-r--r--logger/logger_test.go19
-rw-r--r--main.go17
-rw-r--r--repo/chunk.go17
-rw-r--r--repo/nowindows_test.go17
-rw-r--r--repo/repo.go17
-rw-r--r--repo/repo_test.go17
-rw-r--r--sketch/sketch.go17
-rw-r--r--sketch/sketch_test.go17
-rw-r--r--slice/slice.go91
-rw-r--r--slice/slice_test.go67
-rw-r--r--tar.go43
-rw-r--r--testutils/assert.go17
-rw-r--r--utils/io.go17
-rw-r--r--utils/io_test.go17
-rw-r--r--utils/string.go17
-rw-r--r--utils/string_test.go17
23 files changed, 341 insertions, 202 deletions
diff --git a/Makefile b/Makefile
index 5356b93..a4d4373 100644
--- a/Makefile
+++ b/Makefile
@@ -1,3 +1,20 @@
+# Copyright (C) 2021 Nicolas Peugnet <n.peugnet@free.fr>
+
+# This file is part of dna-backup.
+
+# dna-backup is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+
+# dna-backup is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with dna-backup. If not, see <https://www.gnu.org/licenses/>. */
+
BIN := dna-backup
SRC := $(shell find . -not \( -path './exp' -prune \) -type f -name '*.go')
V := $(if $(CI),-v)
diff --git a/cache/cache.go b/cache/cache.go
index ff2c279..b5bd018 100644
--- a/cache/cache.go
+++ b/cache/cache.go
@@ -1,3 +1,20 @@
+/* Copyright (C) 2021 Nicolas Peugnet <n.peugnet@free.fr>
+
+ This file is part of dna-backup.
+
+ dna-backup is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ dna-backup is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with dna-backup. If not, see <https://www.gnu.org/licenses/>. */
+
package cache
import "sync"
diff --git a/cache/cache_test.go b/cache/cache_test.go
index 6b84b79..df830d4 100644
--- a/cache/cache_test.go
+++ b/cache/cache_test.go
@@ -1,3 +1,20 @@
+/* Copyright (C) 2021 Nicolas Peugnet <n.peugnet@free.fr>
+
+ This file is part of dna-backup.
+
+ dna-backup is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ dna-backup is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with dna-backup. If not, see <https://www.gnu.org/licenses/>. */
+
package cache
import (
diff --git a/delta/delta.go b/delta/delta.go
index 4be57c2..5729ad1 100644
--- a/delta/delta.go
+++ b/delta/delta.go
@@ -1,3 +1,20 @@
+/* Copyright (C) 2021 Nicolas Peugnet <n.peugnet@free.fr>
+
+ This file is part of dna-backup.
+
+ dna-backup is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ dna-backup is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with dna-backup. If not, see <https://www.gnu.org/licenses/>. */
+
package delta
import (
diff --git a/exp/Makefile b/exp/Makefile
index 175ce42..81a9464 100644
--- a/exp/Makefile
+++ b/exp/Makefile
@@ -1,3 +1,20 @@
+# Copyright (C) 2021 Nicolas Peugnet <n.peugnet@free.fr>
+
+# This file is part of dna-backup.
+
+# dna-backup is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+
+# dna-backup is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with dna-backup. If not, see <https://www.gnu.org/licenses/>. */
+
SHELL := /bin/bash
################# Principal parameters #################
diff --git a/exp/exp.sh b/exp/exp.sh
index 0c895b6..923c40c 100755
--- a/exp/exp.sh
+++ b/exp/exp.sh
@@ -1,5 +1,22 @@
#!/bin/bash
+# Copyright (C) 2021 Nicolas Peugnet <n.peugnet@free.fr>
+
+# This file is part of dna-backup.
+
+# dna-backup is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+
+# dna-backup is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with dna-backup. If not, see <https://www.gnu.org/licenses/>. */
+
# This script expects the following variables to be exported:
# - DNA_BACKUP: the path to dna-backup binary
# - DNA_PARAMS: the path of the files that desscribes the multiple parameters to test
diff --git a/logger/logger.go b/logger/logger.go
index 417a0b9..e782d3c 100644
--- a/logger/logger.go
+++ b/logger/logger.go
@@ -1,3 +1,20 @@
+/* Copyright (C) 2021 Nicolas Peugnet <n.peugnet@free.fr>
+
+ This file is part of dna-backup.
+
+ dna-backup is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ dna-backup is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with dna-backup. If not, see <https://www.gnu.org/licenses/>. */
+
// Package logger offers simple logging
package logger
diff --git a/logger/logger_test.go b/logger/logger_test.go
index 2e1ff25..1338110 100644
--- a/logger/logger_test.go
+++ b/logger/logger_test.go
@@ -1,3 +1,20 @@
+/* Copyright (C) 2021 Nicolas Peugnet <n.peugnet@free.fr>
+
+ This file is part of dna-backup.
+
+ dna-backup is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ dna-backup is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with dna-backup. If not, see <https://www.gnu.org/licenses/>. */
+
package logger
import (
@@ -119,7 +136,7 @@ func TestFlags(t *testing.T) {
if !strings.Contains(s, "info 1") {
t.Errorf("log output %q should contain: info 1", s)
}
- path := "logger/logger_test.go:117"
+ path := "logger/logger_test.go:134"
if !strings.Contains(s, path) {
t.Errorf("log output %q should contain: %s", s, path)
}
diff --git a/main.go b/main.go
index 499c4c2..ada0252 100644
--- a/main.go
+++ b/main.go
@@ -1,3 +1,20 @@
+/* Copyright (C) 2021 Nicolas Peugnet <n.peugnet@free.fr>
+
+ This file is part of dna-backup.
+
+ dna-backup is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ dna-backup is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with dna-backup. If not, see <https://www.gnu.org/licenses/>. */
+
package main
import (
diff --git a/repo/chunk.go b/repo/chunk.go
index 618cc9b..d3d4493 100644
--- a/repo/chunk.go
+++ b/repo/chunk.go
@@ -1,3 +1,20 @@
+/* Copyright (C) 2021 Nicolas Peugnet <n.peugnet@free.fr>
+
+ This file is part of dna-backup.
+
+ dna-backup is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ dna-backup is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with dna-backup. If not, see <https://www.gnu.org/licenses/>. */
+
package repo
import (
diff --git a/repo/nowindows_test.go b/repo/nowindows_test.go
index 28752ba..c5161af 100644
--- a/repo/nowindows_test.go
+++ b/repo/nowindows_test.go
@@ -1,5 +1,22 @@
// +build !windows
+/* Copyright (C) 2021 Nicolas Peugnet <n.peugnet@free.fr>
+
+ This file is part of dna-backup.
+
+ dna-backup is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ dna-backup is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with dna-backup. If not, see <https://www.gnu.org/licenses/>. */
+
package repo
import (
diff --git a/repo/repo.go b/repo/repo.go
index 864dc9e..d3a5904 100644
--- a/repo/repo.go
+++ b/repo/repo.go
@@ -1,3 +1,20 @@
+/* Copyright (C) 2021 Nicolas Peugnet <n.peugnet@free.fr>
+
+ This file is part of dna-backup.
+
+ dna-backup is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ dna-backup is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with dna-backup. If not, see <https://www.gnu.org/licenses/>. */
+
/*
Manage a deduplicated versionned backups repository.
diff --git a/repo/repo_test.go b/repo/repo_test.go
index 1384b92..38219e3 100644
--- a/repo/repo_test.go
+++ b/repo/repo_test.go
@@ -1,3 +1,20 @@
+/* Copyright (C) 2021 Nicolas Peugnet <n.peugnet@free.fr>
+
+ This file is part of dna-backup.
+
+ dna-backup is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ dna-backup is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with dna-backup. If not, see <https://www.gnu.org/licenses/>. */
+
package repo
import (
diff --git a/sketch/sketch.go b/sketch/sketch.go
index 7870c3d..3656290 100644
--- a/sketch/sketch.go
+++ b/sketch/sketch.go
@@ -1,3 +1,20 @@
+/* Copyright (C) 2021 Nicolas Peugnet <n.peugnet@free.fr>
+
+ This file is part of dna-backup.
+
+ dna-backup is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ dna-backup is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with dna-backup. If not, see <https://www.gnu.org/licenses/>. */
+
package sketch
import (
diff --git a/sketch/sketch_test.go b/sketch/sketch_test.go
index 851320c..558cbd0 100644
--- a/sketch/sketch_test.go
+++ b/sketch/sketch_test.go
@@ -1,3 +1,20 @@
+/* Copyright (C) 2021 Nicolas Peugnet <n.peugnet@free.fr>
+
+ This file is part of dna-backup.
+
+ dna-backup is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ dna-backup is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with dna-backup. If not, see <https://www.gnu.org/licenses/>. */
+
package sketch
import (
diff --git a/slice/slice.go b/slice/slice.go
deleted file mode 100644
index e5b959e..0000000
--- a/slice/slice.go
+++ /dev/null
@@ -1,91 +0,0 @@
-package slice
-
-import (
- "fmt"
- "reflect"
-)
-
-type Slice []interface{}
-
-type Del int
-
-type Ins struct {
- Idx int
- Value []interface{}
-}
-
-type insData struct {
- idx int
- count int
-}
-
-type Delta struct {
- Del []Del
- Ins []Ins
-}
-
-func (d Delta) String() string {
- data := make([]insData, len(d.Ins))
- for i, ins := range d.Ins {
- data[i] = insData{ins.Idx, len(ins.Value)}
- }
- return fmt.Sprintf("{Del: %d Ins: %+v}", d.Del, data)
-}
-
-func Patch(source Slice, delta Delta) (target Slice) {
- // apply Del part from patch to source into temp
- size := len(source) - len(delta.Del)
- temp := make(Slice, size)
- fill := 0
- prev := 0
- for _, del := range delta.Del {
- di := int(del)
- copy(temp[fill:], source[prev:di])
- fill += di - prev
- prev = di + 1
- }
- copy(temp[fill:], source[prev:])
- // apply Ins part from patch to temp into target
- for _, ins := range delta.Ins {
- size += len(ins.Value)
- }
- target = make(Slice, size)
- fill = 0
- prev = 0
- tpos := 0
- for _, ins := range delta.Ins {
- offset := ins.Idx - prev
- copy(target[fill:], temp[tpos:tpos+offset])
- fill += offset
- tpos += offset
- copy(target[fill:], ins.Value)
- fill += len(ins.Value)
- prev = ins.Idx + len(ins.Value)
- }
- copy(target[fill:], temp[tpos:])
- return
-}
-
-func Diff(source Slice, target Slice) (delta Delta) {
- var si, ti int
- var found bool
- for ; si < len(source); si++ {
- for i := ti; i < len(target); i++ {
- found = reflect.DeepEqual(target[i], source[si])
- if found {
- if i != ti {
- delta.Ins = append(delta.Ins, Ins{ti, target[ti:i]})
- }
- ti = i + 1
- break
- }
- }
- if !found {
- delta.Del = append(delta.Del, Del(si))
- }
- }
- if ti < len(target) {
- delta.Ins = append(delta.Ins, Ins{ti, target[ti:]})
- }
- return
-}
diff --git a/slice/slice_test.go b/slice/slice_test.go
deleted file mode 100644
index 8cb2a68..0000000
--- a/slice/slice_test.go
+++ /dev/null
@@ -1,67 +0,0 @@
-package slice_test
-
-import (
- "testing"
-
- "github.com/n-peugnet/dna-backup/slice"
- "github.com/n-peugnet/dna-backup/testutils"
-)
-
-func TestPatch(t *testing.T) {
- source := slice.Slice{1, 2, 3, 4}
- target := slice.Slice{2, 5, 3, 6, 4, 7, 8}
- patch := slice.Diff(source, target)
- testutils.AssertSame(t, []slice.Del{0}, patch.Del, "Patch del part")
- testutils.AssertSame(t, []slice.Ins{
- {1, slice.Slice{5}},
- {3, slice.Slice{6}},
- {5, slice.Slice{7, 8}},
- }, patch.Ins, "Patch ins part")
- actual := slice.Patch(source, patch)
- testutils.AssertSame(t, target, actual, "Target obtained from patch application")
-}
-
-func TestEmptyPatch(t *testing.T) {
- source := slice.Slice{1, 2, 3, 4}
- target := slice.Slice{1, 2, 3, 4}
- patch := slice.Diff(source, target)
- testutils.AssertSame(t, *new([]slice.Del), patch.Del, "Patch del part")
- testutils.AssertSame(t, *new([]slice.Ins), patch.Ins, "Patch ins part")
- actual := slice.Patch(source, patch)
- testutils.AssertSame(t, target, actual, "Target obtained from patch application")
-}
-
-type i struct {
- int
-}
-
-func TestStruct(t *testing.T) {
- c1, c2, c3, c4, c5, c6, c7, c8 := &i{1}, &i{2}, &i{3}, &i{4}, &i{5}, &i{6}, &i{7}, &i{8}
- source := slice.Slice{c1, c2, c3, c4}
- target := slice.Slice{&i{5}, c2, c5, c6, &i{4}, c7, &i{8}}
- patch := slice.Diff(source, target)
- testutils.AssertSame(t, []slice.Del{0, 2}, patch.Del, "Patch del part")
- testutils.AssertSame(t, []slice.Ins{
- {0, slice.Slice{c5}},
- {2, slice.Slice{c5, c6}},
- {5, slice.Slice{c7, c8}},
- }, patch.Ins, "Patch ins part")
- actual := slice.Patch(source, patch)
- testutils.AssertSame(t, target, actual, "Target obtained from patch application")
-}
-
-func TestDeltaString(t *testing.T) {
- delta := slice.Delta{
- Del: []slice.Del{0, 3, 4},
- Ins: []slice.Ins{
- {2, slice.Slice{6, 7, 8}},
- {5, slice.Slice{5}},
- },
- }
- testutils.AssertSame(
- t,
- "{Del: [0 3 4] Ins: [{idx:2 count:3} {idx:5 count:1}]}",
- delta.String(),
- "Delta string representation",
- )
-}
diff --git a/tar.go b/tar.go
deleted file mode 100644
index 02b8957..0000000
--- a/tar.go
+++ /dev/null
@@ -1,43 +0,0 @@
-package main
-
-import (
- "archive/tar"
- "io"
- "os"
-
- "github.com/n-peugnet/dna-backup/logger"
- "github.com/n-peugnet/dna-backup/repo"
-)
-
-func streamFilesTar(files []repo.File, stream io.WriteCloser) {
- tarStream := tar.NewWriter(stream)
- for _, f := range files {
- file, err := os.Open(f.Path)
- if err != nil {
- logger.Error(err)
- continue
- }
- stat, err := file.Stat()
- if err != nil {
- logger.Errorf("getting stat of file '%s': %s", f.Path, err)
- continue
- }
- hdr, err := tar.FileInfoHeader(stat, "")
- if err != nil {
- logger.Errorf("creating tar header for file '%s': %s", f.Path, err)
- continue
- }
- if err := tarStream.WriteHeader(hdr); err != nil {
- logger.Panicf("writing tar header to stream for file '%s': %s", f.Path, err)
- }
- if _, err := io.Copy(tarStream, file); err != nil {
- logger.Panicf("writing file to stream '%s': %s", f.Path, err)
- }
- }
- if err := tarStream.Close(); err != nil {
- logger.Panic("closing tar stream:", err)
- }
- if err := stream.Close(); err != nil {
- logger.Panic("closing stream:", err)
- }
-}
diff --git a/testutils/assert.go b/testutils/assert.go
index 4a1c6ee..c757a92 100644
--- a/testutils/assert.go
+++ b/testutils/assert.go
@@ -1,3 +1,20 @@
+/* Copyright (C) 2021 Nicolas Peugnet <n.peugnet@free.fr>
+
+ This file is part of dna-backup.
+
+ dna-backup is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ dna-backup is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with dna-backup. If not, see <https://www.gnu.org/licenses/>. */
+
package testutils
import (
diff --git a/utils/io.go b/utils/io.go
index fcc341e..a0aa70c 100644
--- a/utils/io.go
+++ b/utils/io.go
@@ -1,3 +1,20 @@
+/* Copyright (C) 2021 Nicolas Peugnet <n.peugnet@free.fr>
+
+ This file is part of dna-backup.
+
+ dna-backup is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ dna-backup is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with dna-backup. If not, see <https://www.gnu.org/licenses/>. */
+
package utils
import (
diff --git a/utils/io_test.go b/utils/io_test.go
index ad1a576..f994dce 100644
--- a/utils/io_test.go
+++ b/utils/io_test.go
@@ -1,3 +1,20 @@
+/* Copyright (C) 2021 Nicolas Peugnet <n.peugnet@free.fr>
+
+ This file is part of dna-backup.
+
+ dna-backup is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ dna-backup is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with dna-backup. If not, see <https://www.gnu.org/licenses/>. */
+
package utils_test
import (
diff --git a/utils/string.go b/utils/string.go
index b3cbb17..e8533e9 100644
--- a/utils/string.go
+++ b/utils/string.go
@@ -1,3 +1,20 @@
+/* Copyright (C) 2021 Nicolas Peugnet <n.peugnet@free.fr>
+
+ This file is part of dna-backup.
+
+ dna-backup is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ dna-backup is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with dna-backup. If not, see <https://www.gnu.org/licenses/>. */
+
package utils
import (
diff --git a/utils/string_test.go b/utils/string_test.go
index 5d42c24..fab068a 100644
--- a/utils/string_test.go
+++ b/utils/string_test.go
@@ -1,3 +1,20 @@
+/* Copyright (C) 2021 Nicolas Peugnet <n.peugnet@free.fr>
+
+ This file is part of dna-backup.
+
+ dna-backup is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ dna-backup is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with dna-backup. If not, see <https://www.gnu.org/licenses/>. */
+
package utils_test
import (