Skip to content

Commit

Permalink
trying to fix git lint
Browse files Browse the repository at this point in the history
  • Loading branch information
nabim777 committed Aug 28, 2023
1 parent 24f74d3 commit f069c2c
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ import (
"io/ioutil"
"log"
"os"
"fmt"

Check failure on line 11 in main.go

View workflow job for this annotation

GitHub Actions / build

fmt redeclared in this block

Check failure on line 11 in main.go

View workflow job for this annotation

GitHub Actions / build

"fmt" imported and not used
"io"

Check failure on line 12 in main.go

View workflow job for this annotation

GitHub Actions / build

io redeclared in this block

Check failure on line 12 in main.go

View workflow job for this annotation

GitHub Actions / build

"io" imported and not used
"path/filepath"
"strings"

Expand Down Expand Up @@ -237,6 +239,37 @@ func checkAnd(out io.Writer) int {
}

func main() {
file, err := os.Create("example.txt")
if err != nil {
fmt.Println("Error creating file:", err)
return
}
defer file.Close()

message := "Hello, world!"

_, err = io.WriteString(file, message)
if err != nil {
fmt.Println("Error writing to file:", err)
return
}

source := "Source content."

Check failure on line 257 in main.go

View workflow job for this annotation

GitHub Actions / build

source declared and not used (typecheck)
destFile, err := os.Create("copy.txt")
if err != nil {
fmt.Println("Error creating destination file:", err)
return
}
defer destFile.Close()

_, err = io.Copy(destFile, file)
if err != nil {
fmt.Println("Error copying data:", err)
return
}

fmt.Println("Write and copy operations completed successfully.")

out := new(bytes.Buffer)
exitStatus := 0
if len(os.Args) < 2 {
Expand Down

0 comments on commit f069c2c

Please sign in to comment.