mirror of
https://github.com/hanzoai/go-cosyvoice.git
synced 2026-09-30 21:53:53 +00:00
Go 1.27.1, and the code it can say more simply
Modules declare go 1.27.1 and the build images follow. go fix applied the modernizers, and CI tests on 1.27.1 alone; omitzero is not applied, since it changes what the JSON says. Co-authored-by: Hanzo Dev <[email protected]>
This commit is contained in:
@@ -14,7 +14,7 @@ jobs:
|
||||
- name: Setup Go
|
||||
uses: actions/setup-go@v5
|
||||
with:
|
||||
go-version: "1.23"
|
||||
go-version: "1.27.1"
|
||||
- name: Run vet
|
||||
run: |
|
||||
go vet .
|
||||
|
||||
@@ -10,7 +10,7 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
go-version: ["1.22", "1.23"]
|
||||
go-version: ["1.27.1"]
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
@@ -183,8 +183,7 @@ func (c *wsConn) sendMessage(sendCh <-chan Task) {
|
||||
c.ticker.Reset(c.pingInterval)
|
||||
|
||||
if err != nil {
|
||||
var permanent *openairt.PermanentError
|
||||
if errors.As(err, &permanent) {
|
||||
if permanent, ok := errors.AsType[*openairt.PermanentError](err); ok {
|
||||
c.logger.Errorf("send message permanent error: %w", permanent.Err)
|
||||
return
|
||||
}
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
module github.com/hanzoai/go-cosyvoice/examples
|
||||
|
||||
go 1.19
|
||||
go 1.27.1
|
||||
|
||||
require (
|
||||
github.com/faiface/beep v1.1.0
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
github.com/DATA-DOG/go-sqlmock v1.3.3/go.mod h1:f/Ixk793poVmq4qj/V1dPUg2JEAKC73Q5eFN3EC/SaM=
|
||||
github.com/WqyJh/jsontools v0.3.1 h1:zKT+DvxUSTji06ZcjsbQzZ48PycFZDI0OGATmmFhJ+U=
|
||||
github.com/WqyJh/jsontools v0.3.1/go.mod h1:Gk2OlyXjAJmYNZ0aUbEXGHq4I5ihGRjXxVuUprWtkss=
|
||||
github.com/coder/websocket v1.8.12 h1:5bUXkEPPIbewrnkU8LTCLVaxi4N4J8ahufH2vlo4NAo=
|
||||
github.com/coder/websocket v1.8.12/go.mod h1:LNVeNrXQZfe5qhS9ALED3uA+l5pPqvwXg3CKoDBB2gs=
|
||||
github.com/d4l3k/messagediff v1.2.2-0.20190829033028-7e0a312ae40b/go.mod h1:Oozbb1TVXFac9FtSIxHBMnBCq2qeH/2KkEQxENCrlLo=
|
||||
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
|
||||
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||
github.com/faiface/beep v1.1.0 h1:A2gWP6xf5Rh7RG/p9/VAW2jRSDEGQm5sbOb38sf5d4c=
|
||||
github.com/faiface/beep v1.1.0/go.mod h1:6I8p6kK2q4opL/eWb+kAkk38ehnTunWeToJB+s51sT4=
|
||||
github.com/gdamore/encoding v1.0.0/go.mod h1:alR0ol34c49FCSBLjhosxzcPHQbf2trDkoo5dl+VrEg=
|
||||
@@ -22,6 +24,7 @@ github.com/hajimehoshi/oto v0.7.1/go.mod h1:wovJ8WWMfFKvP587mhHgot/MBr4DnNy9m6Ee
|
||||
github.com/hanzoai/go-cosyvoice v1.0.0 h1:XS68KB2VMCmHdAMpcdbkZhK20ZOTPAYm2N1Gx67yJpE=
|
||||
github.com/hanzoai/go-cosyvoice v1.0.0/go.mod h1:uKPJVkJDE8+/j5+HebHrnh/VZ7skUvtJfQrqTJfY6IA=
|
||||
github.com/hanzoai/go-openai v1.41.0 h1:/jF/fZbBHyK7N14mQquUKzCnjwomcuy5YVBIn8AR3NQ=
|
||||
github.com/hanzoai/go-openai v1.41.0/go.mod h1:v0q1gjYS3fpa41xOwzUUXF/julZXhoSmGULcDhmxMY8=
|
||||
github.com/hanzoai/go-openai-realtime v1.0.0 h1:toSd20ii/1zwxk1ULlT6bHZTTdi5qf7AIMzZm0Gy8NY=
|
||||
github.com/hanzoai/go-openai-realtime v1.0.0/go.mod h1:YUQQXTK9zAZvAWriSYm0PnzvApO0EbPiwTT07Ycqrtw=
|
||||
github.com/hanzoai/go-openai-realtime/contrib/ws-gorilla v1.0.0 h1:WOFPnytkj5PGRvupNnS2JXc92k9UhEeQuo+BFyZpl5U=
|
||||
@@ -42,7 +45,9 @@ github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINE
|
||||
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
|
||||
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
|
||||
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
|
||||
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
|
||||
github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg=
|
||||
github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
|
||||
golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8 h1:idBdZTd9UioThJp8KpM/rTSinK/ChZFBE43/WtIy8zg=
|
||||
golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
|
||||
golang.org/x/image v0.0.0-20190220214146-31aff87c08e9/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js=
|
||||
@@ -59,3 +64,4 @@ golang.org/x/sys v0.25.0 h1:r+8e+loiHxRqhXVl6ML1nO3l1+oFoWbnlu2Ehimmi34=
|
||||
golang.org/x/sys v0.25.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
|
||||
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
||||
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
|
||||
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
module github.com/hanzoai/go-cosyvoice
|
||||
|
||||
go 1.19
|
||||
go 1.27.1
|
||||
|
||||
require (
|
||||
github.com/hanzoai/go-openai-realtime v1.0.0
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
github.com/WqyJh/jsontools v0.3.1 h1:zKT+DvxUSTji06ZcjsbQzZ48PycFZDI0OGATmmFhJ+U=
|
||||
github.com/WqyJh/jsontools v0.3.1/go.mod h1:Gk2OlyXjAJmYNZ0aUbEXGHq4I5ihGRjXxVuUprWtkss=
|
||||
github.com/coder/websocket v1.8.12 h1:5bUXkEPPIbewrnkU8LTCLVaxi4N4J8ahufH2vlo4NAo=
|
||||
github.com/coder/websocket v1.8.12/go.mod h1:LNVeNrXQZfe5qhS9ALED3uA+l5pPqvwXg3CKoDBB2gs=
|
||||
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
|
||||
@@ -8,6 +9,7 @@ github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+
|
||||
github.com/gorilla/websocket v1.5.3 h1:saDtZ6Pbx/0u+bgYQ3q96pZgCzfhKXGPqt7kZ72aNNg=
|
||||
github.com/gorilla/websocket v1.5.3/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
|
||||
github.com/hanzoai/go-openai v1.41.0 h1:/jF/fZbBHyK7N14mQquUKzCnjwomcuy5YVBIn8AR3NQ=
|
||||
github.com/hanzoai/go-openai v1.41.0/go.mod h1:v0q1gjYS3fpa41xOwzUUXF/julZXhoSmGULcDhmxMY8=
|
||||
github.com/hanzoai/go-openai-realtime v1.0.0 h1:toSd20ii/1zwxk1ULlT6bHZTTdi5qf7AIMzZm0Gy8NY=
|
||||
github.com/hanzoai/go-openai-realtime v1.0.0/go.mod h1:YUQQXTK9zAZvAWriSYm0PnzvApO0EbPiwTT07Ycqrtw=
|
||||
github.com/hanzoai/go-openai-realtime/contrib/ws-gorilla v1.0.0 h1:WOFPnytkj5PGRvupNnS2JXc92k9UhEeQuo+BFyZpl5U=
|
||||
|
||||
@@ -6,11 +6,11 @@ import (
|
||||
)
|
||||
|
||||
type Header struct {
|
||||
Action Action `json:"action"`
|
||||
TaskID string `json:"task_id"`
|
||||
Streaming string `json:"streaming"`
|
||||
Event string `json:"event"`
|
||||
Attributes map[string]interface{} `json:"attributes"`
|
||||
Action Action `json:"action"`
|
||||
TaskID string `json:"task_id"`
|
||||
Streaming string `json:"streaming"`
|
||||
Event string `json:"event"`
|
||||
Attributes map[string]any `json:"attributes"`
|
||||
Error
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user