mirror of
https://github.com/jixishi/SerialTerminalForWindowsTerminal.git
synced 2026-06-15 16:42:46 +00:00
refactor: move all app code to internal/termapp and entry to cmd/
Consolidate remaining package main files into internal/termapp for clean separation: cmd/serialterminal/ is the sole entry point. Update .goreleaser.yaml to build from ./cmd/serialterminal. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
+2
-1
@@ -17,7 +17,8 @@ before:
|
||||
# - go generate ./...
|
||||
|
||||
builds:
|
||||
- env:
|
||||
- main: ./cmd/serialterminal
|
||||
env:
|
||||
- CGO_ENABLED=0
|
||||
goos:
|
||||
- linux
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
package main
|
||||
|
||||
import "github.com/jixishi/SerialTerminalForWindowsTerminal/internal/termapp"
|
||||
|
||||
func main() {
|
||||
termapp.Run()
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
package main
|
||||
package termapp
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
@@ -1,4 +1,4 @@
|
||||
package main
|
||||
package termapp
|
||||
|
||||
import (
|
||||
"io"
|
||||
@@ -1,4 +1,4 @@
|
||||
package main
|
||||
package termapp
|
||||
|
||||
import (
|
||||
"encoding/hex"
|
||||
@@ -1,4 +1,4 @@
|
||||
package main
|
||||
package termapp
|
||||
|
||||
import (
|
||||
"io"
|
||||
@@ -1,4 +1,4 @@
|
||||
package main
|
||||
package termapp
|
||||
|
||||
import (
|
||||
appconfig "github.com/jixishi/SerialTerminalForWindowsTerminal/internal/config"
|
||||
@@ -1,4 +1,4 @@
|
||||
package main
|
||||
package termapp
|
||||
|
||||
import (
|
||||
"path/filepath"
|
||||
@@ -1,4 +1,4 @@
|
||||
package main
|
||||
package termapp
|
||||
|
||||
import (
|
||||
"testing"
|
||||
@@ -1,4 +1,4 @@
|
||||
package main
|
||||
package termapp
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
@@ -21,7 +21,7 @@ func init() {
|
||||
flag.Init(cfg)
|
||||
}
|
||||
|
||||
func main() {
|
||||
func Run() {
|
||||
defer func() {
|
||||
if r := recover(); r != nil {
|
||||
fmt.Fprintf(os.Stderr, "fatal: %v\n", r)
|
||||
@@ -1,5 +1,5 @@
|
||||
//go:build !windows
|
||||
|
||||
package main
|
||||
package termapp
|
||||
|
||||
func enableVTInput(fd int) {}
|
||||
@@ -1,6 +1,6 @@
|
||||
//go:build windows
|
||||
|
||||
package main
|
||||
package termapp
|
||||
|
||||
import (
|
||||
"golang.org/x/sys/windows"
|
||||
@@ -1,4 +1,4 @@
|
||||
package main
|
||||
package termapp
|
||||
|
||||
import (
|
||||
"io"
|
||||
@@ -1,4 +1,4 @@
|
||||
package main
|
||||
package termapp
|
||||
|
||||
import (
|
||||
"strings"
|
||||
@@ -1,4 +1,4 @@
|
||||
package main
|
||||
package termapp
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
@@ -1,4 +1,4 @@
|
||||
package main
|
||||
package termapp
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
@@ -1,4 +1,4 @@
|
||||
package main
|
||||
package termapp
|
||||
|
||||
import (
|
||||
"strings"
|
||||
@@ -1,4 +1,4 @@
|
||||
package main
|
||||
package termapp
|
||||
|
||||
import (
|
||||
"strings"
|
||||
Reference in New Issue
Block a user