diff --git a/main.go b/main.go index 13e6934..de7b9ca 100644 --- a/main.go +++ b/main.go @@ -3,6 +3,7 @@ package main import ( "bufio" "fmt" + "io" "os" "sort" @@ -68,7 +69,18 @@ func printComments(wrapper *wrap.Wrapper, commentsByFile map[string]([]*gitea.Pu } } -func patchFiles(wrapper *wrap.Wrapper, commentsByFile map[string]([]*gitea.PullReviewComment)) { +func BackUpSource(filepath string) { + inputFile, err := os.Open(filepath) + ExitOnError(err) + defer inputFile.Close() + + BackUpSourceFile, err := os.Create(filepath + ".bck") + ExitOnError(err) + defer BackUpSourceFile.Close() + + _, err = io.Copy(BackUpSourceFile, inputFile) + ExitOnError(err) +} for filepath, comments := range commentsByFile { fmt.Printf("FILE: %s\n", filepath)