Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions .github/workflows/golangci-lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: golangci-lint

on:
push:
branches:
- main
pull_request:

permissions:
contents: read

jobs:
golangci:
name: lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5

- uses: actions/setup-go@v5
with:
go-version-file: 'go.mod'

- name: golangci-lint
uses: golangci/golangci-lint-action@v8
with:
version: v2.1
6 changes: 6 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
version: "2"

linters:
disable:
# We check error as part of our PR process.
- errcheck
6 changes: 2 additions & 4 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ require (
github.com/aws/aws-sdk-go-v2/service/signer v1.31.1
github.com/aws/aws-signer-notation-plugin v1.0.2292
github.com/charmbracelet/fang v0.3.0
github.com/charmbracelet/lipgloss/v2 v2.0.0-beta.2
github.com/egym-playground/go-prefix-writer v0.0.0-20180609083313-7326ea162eca
github.com/fatih/color v1.18.0
github.com/fsouza/go-dockerclient v1.12.2
github.com/gliderlabs/ssh v0.3.8
github.com/go-test/deep v1.1.1
github.com/gorilla/mux v1.8.1
github.com/gosuri/uilive v0.0.4
Expand All @@ -40,6 +40,7 @@ require (
golang.org/x/crypto v0.41.0
golang.org/x/oauth2 v0.30.0
golang.org/x/sync v0.16.0
golang.org/x/term v0.34.0
google.golang.org/grpc v1.66.0
gopkg.in/yaml.v2 v2.4.0
oras.land/oras-go/v2 v2.6.0
Expand All @@ -49,7 +50,6 @@ require (
github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1 // indirect
github.com/Azure/go-ntlmssp v0.0.0-20221128193559-754e69321358 // indirect
github.com/Microsoft/go-winio v0.6.2 // indirect
github.com/anmitsu/go-shlex v0.0.0-20200514113438-38f4b401e2be // indirect
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.18.5 // indirect
github.com/aws/aws-sdk-go-v2/internal/configsources v1.4.5 // indirect
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.7.5 // indirect
Expand All @@ -61,7 +61,6 @@ require (
github.com/aws/aws-sdk-go-v2/service/sts v1.38.1 // indirect
github.com/aws/smithy-go v1.23.0 // indirect
github.com/charmbracelet/colorprofile v0.3.1 // indirect
github.com/charmbracelet/lipgloss/v2 v2.0.0-beta.2 // indirect
github.com/charmbracelet/x/ansi v0.8.0 // indirect
github.com/charmbracelet/x/cellbuf v0.0.13 // indirect
github.com/charmbracelet/x/exp/charmtone v0.0.0-20250603201427-c31516f43444 // indirect
Expand Down Expand Up @@ -111,7 +110,6 @@ require (
github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e // indirect
golang.org/x/net v0.42.0 // indirect
golang.org/x/sys v0.35.0 // indirect
golang.org/x/term v0.34.0 // indirect
golang.org/x/text v0.28.0 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20250728155136-f173205681a0 // indirect
google.golang.org/protobuf v1.36.8 // indirect
Expand Down
31 changes: 0 additions & 31 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@ github.com/TylerBrock/colorjson v0.0.0-20200706003622-8a50f05110d2 h1:ZBbLwSJqkH
github.com/TylerBrock/colorjson v0.0.0-20200706003622-8a50f05110d2/go.mod h1:VSw57q4QFiWDbRnjdX8Cb3Ow0SFncRw+bA/ofY6Q83w=
github.com/alexbrainman/sspi v0.0.0-20231016080023-1a75b4708caa h1:LHTHcTQiSGT7VVbI0o4wBRNQIgn917usHWOd6VAffYI=
github.com/alexbrainman/sspi v0.0.0-20231016080023-1a75b4708caa/go.mod h1:cEWa1LVoE5KvSD9ONXsZrj0z6KqySlCCNKHlLzbqAt4=
github.com/anmitsu/go-shlex v0.0.0-20200514113438-38f4b401e2be h1:9AeTilPcZAjCFIImctFaOjnTIavg87rW78vTPkQqLI8=
github.com/anmitsu/go-shlex v0.0.0-20200514113438-38f4b401e2be/go.mod h1:ySMOLuWl6zY27l47sB3qLNK6tF2fkHG55UZxx8oIVo4=
github.com/aquasecurity/table v1.11.0 h1:SzgCAv7dZcv/gyAyzxorS6OgEk7w/WU5iT2pStIkpl4=
github.com/aquasecurity/table v1.11.0/go.mod h1:eqOmvjjB7AhXFgFqpJUEE/ietg7RrMSJZXyTN8E/wZw=
github.com/aws/aws-sdk-go-v2 v1.38.2 h1:QUkLO1aTW0yqW95pVzZS0LGFanL71hJ0a49w4TJLMyM=
Expand Down Expand Up @@ -93,16 +91,10 @@ github.com/fsouza/go-dockerclient v1.12.2 h1:+pbP/SacoHfqaVZuiudvcdYGd9jzU7y9Ecg
github.com/fsouza/go-dockerclient v1.12.2/go.mod h1:ZGCkAsnBGjnTRG9wV6QaICPJ5ig2KlaxTccDQy5WQ38=
github.com/fxamacker/cbor/v2 v2.8.0 h1:fFtUGXUzXPHTIUdne5+zzMPTfffl3RD5qYnkY40vtxU=
github.com/fxamacker/cbor/v2 v2.8.0/go.mod h1:vM4b+DJCtHn+zz7h3FFp/hDAI9WNWCsZj23V5ytsSxQ=
github.com/gliderlabs/ssh v0.3.8 h1:a4YXD1V7xMF9g5nTkdfnja3Sxy1PVDCj1Zg4Wb8vY6c=
github.com/gliderlabs/ssh v0.3.8/go.mod h1:xYoytBv1sV0aL3CavoDuJIQNURXkkfPA/wxQ1pL1fAU=
github.com/go-asn1-ber/asn1-ber v1.5.7 h1:DTX+lbVTWaTw1hQ+PbZPlnDZPEIs0SS/GCZAl535dDk=
github.com/go-asn1-ber/asn1-ber v1.5.7/go.mod h1:hEBeB/ic+5LoWskz+yKT7vGhhPYkProFKoKdwZRWMe0=
github.com/go-ldap/ldap/v3 v3.4.10 h1:ot/iwPOhfpNVgB1o+AVXljizWZ9JTp7YF5oeyONmcJU=
github.com/go-ldap/ldap/v3 v3.4.10/go.mod h1:JXh4Uxgi40P6E9rdsYqpUtbW46D9UTjJ9QSwGRznplY=
github.com/go-logr/logr v1.4.3 h1:CjnDlHq8ikf6E492q6eKboGOC0T8CDaOvkHCIg8idEI=
github.com/go-logr/logr v1.4.3/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY=
github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag=
github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE=
github.com/go-test/deep v1.1.1 h1:0r/53hagsehfO4bzD2Pgr/+RgHqhmf+k1Bpse2cTu1U=
github.com/go-test/deep v1.1.1/go.mod h1:5C2ZWiW0ErCdrYzpqxLbTX7MG14M9iiw8DgHncVwcsE=
github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q=
Expand All @@ -111,9 +103,6 @@ github.com/golang-jwt/jwt/v4 v4.5.2 h1:YtQM7lnr8iZ+j5q71MGKkNw9Mn7AjHM68uc9g5fXe
github.com/golang-jwt/jwt/v4 v4.5.2/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w39/MY0Ch0=
github.com/golang/mock v1.6.0 h1:ErTB+efbowRARo13NNdxyJji2egdxLGQhRaY+DUumQc=
github.com/golang/mock v1.6.0/go.mod h1:p6yTPP+5HYm5mzsMV8JkE6ZKdX+/wYM6Hr+LicevLPs=
github.com/golang/protobuf v1.5.0 h1:LUVKkCeviFUMKqHa4tXIIij/lbhnMbP7Fn5wKdKkRh4=
github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek=
github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps=
github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
Expand Down Expand Up @@ -228,8 +217,6 @@ github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ
github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ=
github.com/skpr/api v1.0.0 h1:qkSSu2UHJc8q9zx31Yt0dO1hnMBVGfEnWHbs3SP7I/g=
github.com/skpr/api v1.0.0/go.mod h1:LUk85PpDn7rf8Vqx9nTzmVfrK+GZikfZkKAy9o76zPI=
github.com/skpr/api v1.1.3 h1:4keYcAC6sdkImcmCULLwm00j9LTAUXubbCi5muJ2nFw=
github.com/skpr/api v1.1.3/go.mod h1:8B6c7H8DP4pw+yzcvKLJmR7As7snTlF+kgTz/IiADYU=
github.com/skratchdot/open-golang v0.0.0-20200116055534-eef842397966 h1:JIAuq3EEf9cgbU6AtGPK4CTG3Zf6CKMNqf0MHTggAUA=
github.com/skratchdot/open-golang v0.0.0-20200116055534-eef842397966/go.mod h1:sUM3LWHvSMaG192sy56D9F7CNvL7jUJVXoqM1QKLnog=
github.com/spf13/cobra v1.9.1 h1:CXSaggrXdbHK9CF+8ywj8Amf7PBRmPCOJugH954Nnlo=
Expand Down Expand Up @@ -259,18 +246,6 @@ github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e/go.mod h1:RbqR21r5mrJu
github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY=
go.opentelemetry.io/auto/sdk v1.1.0 h1:cH53jehLUN6UFLY71z+NDOiNJqDdPRaXzTel0sJySYA=
go.opentelemetry.io/auto/sdk v1.1.0/go.mod h1:3wSPjt5PWp2RhlCcmmOial7AvC4DQqZb7a7wCow3W8A=
go.opentelemetry.io/otel v1.37.0 h1:9zhNfelUvx0KBfu/gb+ZgeAfAgtWrfHJZcAqFC228wQ=
go.opentelemetry.io/otel v1.37.0/go.mod h1:ehE/umFRLnuLa/vSccNq9oS1ErUlkkK71gMcN34UG8I=
go.opentelemetry.io/otel/metric v1.37.0 h1:mvwbQS5m0tbmqML4NqK+e3aDiO02vsf/WgbsdpcPoZE=
go.opentelemetry.io/otel/metric v1.37.0/go.mod h1:04wGrZurHYKOc+RKeye86GwKiTb9FKm1WHtO+4EVr2E=
go.opentelemetry.io/otel/sdk v1.37.0 h1:ItB0QUqnjesGRvNcmAcU0LyvkVyGJ2xftD29bWdDvKI=
go.opentelemetry.io/otel/sdk v1.37.0/go.mod h1:VredYzxUvuo2q3WRcDnKDjbdvmO0sCzOvVAiY+yUkAg=
go.opentelemetry.io/otel/sdk/metric v1.37.0 h1:90lI228XrB9jCMuSdA0673aubgRobVZFhbjxHHspCPc=
go.opentelemetry.io/otel/sdk/metric v1.37.0/go.mod h1:cNen4ZWfiD37l5NhS+Keb5RXVWZWpRE+9WyVCpbo5ps=
go.opentelemetry.io/otel/trace v1.37.0 h1:HLdcFNbRQBE2imdSEgm/kwqmQj1Or1l/7bW6mxVK7z4=
go.opentelemetry.io/otel/trace v1.37.0/go.mod h1:TlgrlQ+PtQO5XFerSPUYG0JSgGyryXewPGyayAWSBS0=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
Expand Down Expand Up @@ -380,16 +355,10 @@ golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8T
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
gonum.org/v1/gonum v0.16.0 h1:5+ul4Swaf3ESvrOnidPp4GZbzf0mxVQpDCYUQE7OJfk=
gonum.org/v1/gonum v0.16.0/go.mod h1:fef3am4MQ93R2HHpKnLk4/Tbh/s0+wqD5nfa6Pnwy4E=
google.golang.org/genproto/googleapis/rpc v0.0.0-20250728155136-f173205681a0 h1:MAKi5q709QWfnkkpNQ0M12hYJ1+e8qYVDyowc4U1XZM=
google.golang.org/genproto/googleapis/rpc v0.0.0-20250728155136-f173205681a0/go.mod h1:qQ0YXyHHx3XkvlzUtpXDkS29lDSafHMZBAZDc03LQ3A=
google.golang.org/grpc v1.66.0 h1:DibZuoBznOxbDQxRINckZcUvnCEvrW9pcWIE2yF9r1c=
google.golang.org/grpc v1.66.0/go.mod h1:s3/l6xSSCURdVfAnL+TqCNMyTDAGN6+lZeVxnZR128Y=
google.golang.org/grpc v1.67.0 h1:IdH9y6PF5MPSdAntIcpjQ+tXO41pcQsfZV2RxtQgVcw=
google.golang.org/grpc v1.67.0/go.mod h1:1gLDyUQU7CTLJI90u3nXZ9ekeghjeM7pTDZlqFNg2AA=
google.golang.org/grpc v1.75.0 h1:+TW+dqTd2Biwe6KKfhE5JpiYIBWq865PhKGSXiivqt4=
google.golang.org/grpc v1.75.0/go.mod h1:JtPAzKiq4v1xcAB2hydNlWI2RnF85XXcV0mhKXr2ecQ=
google.golang.org/protobuf v1.36.8 h1:xHScyCOEuuwZEc6UtSOvPbAT4zRh0xcNRYekJwfqyMc=
google.golang.org/protobuf v1.36.8/go.mod h1:fuxRtAxBytpl4zzqUh6/eyUujkJdNiuEkXntxiD/uRU=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
Expand Down
6 changes: 3 additions & 3 deletions internal/client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ import (
"github.com/aws/aws-sdk-go-v2/aws"
"google.golang.org/grpc"
"google.golang.org/grpc/credentials"
"google.golang.org/grpc/credentials/insecure"
"google.golang.org/grpc/metadata"

"github.com/skpr/api/pb"

"github.com/skpr/cli/internal/client/config/clusters"
skprcredentials "github.com/skpr/cli/internal/client/config/credentials"
skprdiscovery "github.com/skpr/cli/internal/client/config/discovery"
Expand Down Expand Up @@ -71,10 +71,10 @@ func Dial(api clusters.API) (*grpc.ClientConn, error) {
server := fmt.Sprintf("%s:%d", api.Host, api.Port)

if api.Insecure {
return grpc.Dial(server, grpc.WithInsecure())
return grpc.NewClient(server, grpc.WithTransportCredentials(insecure.NewCredentials()))
}

return grpc.Dial(server, grpc.WithTransportCredentials(credentials.NewClientTLSFromCert(nil, "")))
return grpc.NewClient(server, grpc.WithTransportCredentials(credentials.NewClientTLSFromCert(nil, "")))
}

// NewFromFile loads a file and uses that configuration to return a client.
Expand Down
5 changes: 4 additions & 1 deletion internal/client/config/clusters/clusters.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,10 @@ func LoadFromFile(file, name string) (Cluster, error) {

// If the cluster is specified, let's use that.
if _, ok := clusters[name]; ok {
mergo.Merge(&cluster, clusters[name], mergo.WithOverride)
err = mergo.Merge(&cluster, clusters[name], mergo.WithOverride)
if err != nil {
return cluster, errors.Wrap(err, "failed to merge config")
}
}

err = cluster.Validate()
Expand Down
3 changes: 1 addition & 2 deletions internal/client/config/command/aliases/aliases.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,7 @@ func Expand(args []string, aliases command.Aliases) (bool, []string, error) {
return found, []string{}, err
}

var newArgs []string
newArgs = strings.Split(expansion, " ")
var newArgs = strings.Split(expansion, " ")

expanded := append(newArgs, extraArgs...)
return found, expanded, nil
Expand Down
3 changes: 1 addition & 2 deletions internal/client/config/command/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package command

import (
"fmt"
"io/ioutil"
"os"
"path/filepath"

Expand Down Expand Up @@ -72,7 +71,7 @@ func (c *ConfigFile) Write(config Config) error {
}
}

err = ioutil.WriteFile(c.Filename, data, 0600)
err = os.WriteFile(c.Filename, data, 0600)
if err != nil {
return fmt.Errorf("failed to write command config to file: %w", err)
}
Expand Down
6 changes: 1 addition & 5 deletions internal/client/config/credentials/cache/cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,7 @@ func Exists(clusterName string) bool {
}

_, err = os.Stat(path)
if err != nil {
return false
}

return true
return err == nil
}

// Delete a credentials cache file for a cluster.
Expand Down
3 changes: 1 addition & 2 deletions internal/client/config/credentials/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package credentials
import (
"errors"
"fmt"
"io/ioutil"
"os"
"path/filepath"

Expand Down Expand Up @@ -110,7 +109,7 @@ func (c *Config) Write(clusters Clusters) error {
}
}

err = ioutil.WriteFile(c.file, data, 0600)
err = os.WriteFile(c.file, data, 0600)
if err != nil {
return fmt.Errorf("failed to write clusters to file: %w", err)
}
Expand Down
1 change: 1 addition & 0 deletions internal/client/config/project/initializer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ func TestInitialize(t *testing.T) {
assert.NoError(err)

sub, err := fs.Sub(resources, "resources")
assert.NoError(err)

f, err := sub.Open("config.yml")
assert.NoError(err)
Expand Down
8 changes: 2 additions & 6 deletions internal/client/config/project/proto.go
Original file line number Diff line number Diff line change
Expand Up @@ -202,15 +202,11 @@ func protoSanitize(mysql *DatabaseSanitize) *pb.SanitizationPolicy {
var wheres []*pb.SanitizationWhere

if len(mysql.Rules.NoData) > 0 {
for _, value := range mysql.Rules.NoData {
nodatas = append(nodatas, value)
}
nodatas = append(nodatas, mysql.Rules.NoData...)
}

if len(mysql.Rules.Ignore) > 0 {
for _, value := range mysql.Rules.Ignore {
ignores = append(ignores, value)
}
ignores = append(ignores, mysql.Rules.Ignore...)
}

if len(mysql.Rules.Rewrite) > 0 {
Expand Down
30 changes: 0 additions & 30 deletions internal/client/ssh/error.go

This file was deleted.

2 changes: 1 addition & 1 deletion internal/client/ssh/exec.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (
// Exec a command in the remote environment.
func (c Client) Exec(params ExecParams) error {
if len(params.Command) == 0 {
return errors.New("Command was not provided")
return errors.New("command was not provided")
}

awsCreds, err := c.CredentialsProvider.Retrieve(context.TODO())
Expand Down
8 changes: 4 additions & 4 deletions internal/client/ssh/shell.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (

"github.com/olekukonko/ts"
"golang.org/x/crypto/ssh"
"golang.org/x/crypto/ssh/terminal"
"golang.org/x/term"
)

// Shell creates a long lived "shell" session for the user.
Expand Down Expand Up @@ -62,13 +62,13 @@ func (c Client) Shell(params ShellParams) error {
termHeight = 24
)

if terminal.IsTerminal(fd) {
oldState, err := terminal.MakeRaw(fd)
if term.IsTerminal(fd) {
oldState, err := term.MakeRaw(fd)
if err != nil {
return err
}

defer terminal.Restore(fd, oldState)
defer term.Restore(fd, oldState)

size, err := ts.GetSize()
if err == nil {
Expand Down
26 changes: 0 additions & 26 deletions internal/client/ssh/utils.go
Original file line number Diff line number Diff line change
@@ -1,35 +1,9 @@
package ssh

import (
"fmt"
"io"
"strings"

"github.com/gliderlabs/ssh"
)

// Separator used for distinquishing between a namespace and exec object name.
const (
// UsernameSeparator separates a project from the environment.
UsernameSeparator = "~"
// PasswordSeparator separates credentials for access.
PasswordSeparator = ":"
)

// Helper function to return errors back to the user.
func printError(s ssh.Session, err error) {
io.WriteString(s, err.Error())
s.Exit(1)
}

// Helper function to extract namespace and name from a user.
func extractFromUser(user string) (string, string, error) {
sl := strings.Split(user, UsernameSeparator)

if len(sl) == 2 {
// Translate this
return sl[0], sl[1], nil
}

return "", "", fmt.Errorf("failed to marshal string: %s", user)
}
Loading