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:
@@ -20,7 +20,7 @@ import (
|
|||||||
"testing"
|
"testing"
|
||||||
"time"
|
"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()) {
|
func newUnixHTTPTestServer(t *testing.T, handler http.Handler) (string, func()) {
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
"sync"
|
"sync"
|
||||||
|
|
||||||
"github.com/rcarmo/webterm-go-port/terminalstate"
|
"github.com/rcarmo/webterm-go-port/internal/terminalstate"
|
||||||
)
|
)
|
||||||
|
|
||||||
type DockerExecSpec struct {
|
type DockerExecSpec struct {
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
package webterm
|
package webterm
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/rcarmo/webterm-go-port/terminalstate"
|
"github.com/rcarmo/webterm-go-port/internal/terminalstate"
|
||||||
)
|
)
|
||||||
|
|
||||||
type SessionConnector interface {
|
type SessionConnector interface {
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import (
|
|||||||
"html"
|
"html"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/rcarmo/webterm-go-port/terminalstate"
|
"github.com/rcarmo/webterm-go-port/internal/terminalstate"
|
||||||
)
|
)
|
||||||
|
|
||||||
var ansiColors = map[string]string{
|
var ansiColors = map[string]string{
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/rcarmo/webterm-go-port/terminalstate"
|
"github.com/rcarmo/webterm-go-port/internal/terminalstate"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestRenderTerminalSVG(t *testing.T) {
|
func TestRenderTerminalSVG(t *testing.T) {
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ import (
|
|||||||
|
|
||||||
"github.com/creack/pty"
|
"github.com/creack/pty"
|
||||||
"github.com/google/shlex"
|
"github.com/google/shlex"
|
||||||
"github.com/rcarmo/webterm-go-port/terminalstate"
|
"github.com/rcarmo/webterm-go-port/internal/terminalstate"
|
||||||
)
|
)
|
||||||
|
|
||||||
type TerminalSession struct {
|
type TerminalSession struct {
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ package webterm
|
|||||||
import (
|
import (
|
||||||
"sync"
|
"sync"
|
||||||
|
|
||||||
"github.com/rcarmo/webterm-go-port/terminalstate"
|
"github.com/rcarmo/webterm-go-port/internal/terminalstate"
|
||||||
)
|
)
|
||||||
|
|
||||||
type fakeSession struct {
|
type fakeSession struct {
|
||||||
|
|||||||
Reference in New Issue
Block a user