refactor: standardize Go layout with internal terminalstate

Audit findings: cmd/webterm and webterm package were acceptable, but terminalstate
was an internal implementation detail exposed as a public package.

Changes:
- Move go/terminalstate -> go/internal/terminalstate
- Update imports to github.com/rcarmo/webterm-go-port/internal/terminalstate
- Keep package name terminalstate unchanged

Resulting package layout:
- github.com/rcarmo/webterm-go-port/cmd/webterm
- github.com/rcarmo/webterm-go-port/internal/terminalstate
- github.com/rcarmo/webterm-go-port/webterm

Validation:
- go test ./...
- go test -race ./...
- go coverage check remains 80.9%
- make check

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
GitHub Copilot
2026-02-14 17:13:49 +00:00
parent f597f8f99d
commit 065de286fb
9 changed files with 7 additions and 7 deletions
+1 -1
View File
@@ -20,7 +20,7 @@ import (
"testing"
"time"
"github.com/rcarmo/webterm-go-port/terminalstate"
"github.com/rcarmo/webterm-go-port/internal/terminalstate"
)
func newUnixHTTPTestServer(t *testing.T, handler http.Handler) (string, func()) {
+1 -1
View File
@@ -13,7 +13,7 @@ import (
"strings"
"sync"
"github.com/rcarmo/webterm-go-port/terminalstate"
"github.com/rcarmo/webterm-go-port/internal/terminalstate"
)
type DockerExecSpec struct {
+1 -1
View File
@@ -1,7 +1,7 @@
package webterm
import (
"github.com/rcarmo/webterm-go-port/terminalstate"
"github.com/rcarmo/webterm-go-port/internal/terminalstate"
)
type SessionConnector interface {
+1 -1
View File
@@ -5,7 +5,7 @@ import (
"html"
"strings"
"github.com/rcarmo/webterm-go-port/terminalstate"
"github.com/rcarmo/webterm-go-port/internal/terminalstate"
)
var ansiColors = map[string]string{
+1 -1
View File
@@ -4,7 +4,7 @@ import (
"strings"
"testing"
"github.com/rcarmo/webterm-go-port/terminalstate"
"github.com/rcarmo/webterm-go-port/internal/terminalstate"
)
func TestRenderTerminalSVG(t *testing.T) {
+1 -1
View File
@@ -10,7 +10,7 @@ import (
"github.com/creack/pty"
"github.com/google/shlex"
"github.com/rcarmo/webterm-go-port/terminalstate"
"github.com/rcarmo/webterm-go-port/internal/terminalstate"
)
type TerminalSession struct {
+1 -1
View File
@@ -3,7 +3,7 @@ package webterm
import (
"sync"
"github.com/rcarmo/webterm-go-port/terminalstate"
"github.com/rcarmo/webterm-go-port/internal/terminalstate"
)
type fakeSession struct {