sumn light

This commit is contained in:
bobbert committed 2026-07-17 02:03:39 +01:00
1 parent f0f92c276f
commit e53f7b5436
3 files changed
+50 -11

No files matched your search

+47 -1
View File
@@ -1,3 +1,49 @@
package main
func main() {}
import (
"bufio"
"fmt"
"os"
"path/filepath"
"strings"
"golang.org/x/term"
)
func main() {
// Create a reader
reader := bufio.NewReader(os.Stdin)
//Create a file path:
err := os.Mkdir("./Log", os.ModePerm)
check(err)
path := filepath.Join("./Log", "TerminalLog.txt")
file, _ := os.Create(path) // Creating the file and assinging it the variable file
// Create a writer
writer := bufio.NewWriter(file)
// The rest.
fmt.Println("Enter in commands you were to run in the terminal, this go file acts as a middle man recorder: \n")
input, _ := reader.ReadString('.')
var inputs []string
cleanedInput := strings.Split(inputs, "\n")
writer.WriteString(cleanedInput)
term.NewTerminal(_, input) * Terminal
defer writer.Flush()
defer file.Close()
}
func check(e error) {
if e != nil {
panic(e)
}
}
+3 -6
View File
@@ -2,9 +2,6 @@ module LearningGo
go 1.26.5
require (
github.com/howeyc/gopass v0.0.0-20210920133722-c8aef6fb66ef // indirect
golang.org/x/crypto v0.54.0 // indirect
golang.org/x/sys v0.47.0 // indirect
golang.org/x/term v0.45.0 // indirect
)
require golang.org/x/term v0.45.0
require golang.org/x/sys v0.47.0 // indirect
-4
View File
@@ -1,7 +1,3 @@
github.com/howeyc/gopass v0.0.0-20210920133722-c8aef6fb66ef h1:A9HsByNhogrvm9cWb28sjiS3i7tcKCkflWFEkHfuAgM=
github.com/howeyc/gopass v0.0.0-20210920133722-c8aef6fb66ef/go.mod h1:lADxMC39cJJqL93Duh1xhAs4I2Zs8mKS89XWXFGp9cs=
golang.org/x/crypto v0.54.0 h1:YLIA59K4fiNzHzjnZt2tUJQjQtUWfWbeHBqKtk3eScw=
golang.org/x/crypto v0.54.0/go.mod h1:KWL8ny2AZdGR2cWmzeHrp2azQPGogOv+HeQaVEXC2dk=
golang.org/x/sys v0.47.0 h1:o7XGOvZQCADBQQ4Y7VNq2dRWQR7JmOUW8Kxx4ZsNgWs=
golang.org/x/sys v0.47.0/go.mod h1:4GL1E5IUh+htKOUEOaiffhrAeqysfVGipDYzABqnCmw=
golang.org/x/term v0.45.0 h1:NwWyBmoJCbfTHpxrWoZ9C6/VxOf7ic219I8xZZFdrf0=