Skip to content

Commit d999ccb

Browse files
committed
refactor: reorganize project structure
1 parent 0a29e39 commit d999ccb

File tree

6 files changed

+11
-10
lines changed

6 files changed

+11
-10
lines changed

main.go cmd/main.go

+5-4
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,19 @@
11
package main
22

33
import (
4-
"backmeup/archiver"
5-
"backmeup/config"
64
"fmt"
7-
"github.com/akamensky/argparse"
8-
"github.com/bmatcuk/doublestar/v2"
95
"io/fs"
106
"log"
117
"os"
128
"path/filepath"
139
"runtime"
1410
"strings"
1511
"time"
12+
13+
"github.com/akamensky/argparse"
14+
"github.com/bmatcuk/doublestar/v2"
15+
"github.com/d-Rickyy-b/backmeup/internal/archiver"
16+
"github.com/d-Rickyy-b/backmeup/internal/config"
1617
)
1718

1819
var VERBOSE bool

main_test.go cmd/main_test.go

File renamed without changes.

go.mod

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
module backmeup
1+
module github.com/d-Rickyy-b/backmeup
22

33
go 1.16
44

archiver/archive.go internal/archiver/archive.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@ package archiver
22

33
import (
44
"archive/tar"
5-
"backmeup/config"
65
"errors"
76
"fmt"
87
"github.com/cheggaaa/pb/v3"
8+
"github.com/d-Rickyy-b/backmeup/internal/config"
99
"github.com/klauspost/compress/gzip"
1010
"github.com/klauspost/compress/zip"
1111
"io"
File renamed without changes.

config/config.go internal/config/config.go

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
package config
22

33
import (
4-
"backmeup/bkperrors"
5-
"gopkg.in/yaml.v2"
6-
"io/ioutil"
74
"log"
85
"os"
6+
7+
"github.com/d-Rickyy-b/backmeup/internal/bkperrors"
8+
"gopkg.in/yaml.v2"
99
)
1010

1111
type Unit struct {
@@ -153,7 +153,7 @@ func (config *Config) validate() error {
153153
// ReadConfig reads a config file from a given path
154154
func ReadConfig(configPath string) (Config, error) {
155155
log.Printf("Trying to read config file '%s'!", configPath)
156-
data, err := ioutil.ReadFile(configPath)
156+
data, err := os.ReadFile(configPath)
157157

158158
if err != nil {
159159
log.Println("Can't read config file! Exiting!")

0 commit comments

Comments
 (0)