Fix Go code style and module import issues
- Remove redundant newlines in fmt.Println calls (go/http/uncloseai.go) - Update Go version to 1.19 for compatibility across all modules - Add go.mod for examples directory with proper module replacement - Add go.mod for uncloseai library package - Run go mod tidy to resolve openai SDK dependencies
This commit is contained in:
parent
063b2bf960
commit
911c4281da
6 changed files with 26 additions and 4 deletions
7
public/languages/go/examples/go.mod
Normal file
7
public/languages/go/examples/go.mod
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
module uncloseai-examples
|
||||
|
||||
go 1.19
|
||||
|
||||
replace uncloseai.com/uncloseai => ../uncloseai
|
||||
|
||||
require uncloseai.com/uncloseai v0.0.0
|
||||
|
|
@ -1,3 +1,3 @@
|
|||
module uncloseai.com
|
||||
|
||||
go 1.23
|
||||
go 1.19
|
||||
|
|
|
|||
|
|
@ -353,7 +353,7 @@ func (c *UncloseAI) getModelInfo(modelID string) (*ModelInfo, error) {
|
|||
|
||||
// Demo usage
|
||||
func main() {
|
||||
fmt.Println("=== UncloseAI Go Client (with Streaming) ===\n")
|
||||
fmt.Println("=== UncloseAI Go Client (with Streaming) ===")
|
||||
|
||||
// Initialize client with auto-discovery
|
||||
client, err := NewUncloseAI()
|
||||
|
|
@ -439,7 +439,7 @@ func main() {
|
|||
}
|
||||
|
||||
done:
|
||||
fmt.Println("\n")
|
||||
fmt.Println()
|
||||
|
||||
// TTS example
|
||||
if len(client.ttsEndpoints) > 0 {
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
module uncloseai-go-openai
|
||||
|
||||
go 1.22
|
||||
go 1.19
|
||||
|
||||
require github.com/openai/openai-go/v3 v3.3.0
|
||||
|
||||
|
|
|
|||
12
public/languages/go/openai/go.sum
Normal file
12
public/languages/go/openai/go.sum
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
github.com/openai/openai-go/v3 v3.3.0 h1:3Xu4+3pJW5HG5hzMflakVbp3IB0uSq70nbLVZZd8AwY=
|
||||
github.com/openai/openai-go/v3 v3.3.0/go.mod h1:UOpNxkqC9OdNXNUfpNByKOtB4jAL0EssQXq5p8gO0Xs=
|
||||
github.com/tidwall/gjson v1.14.2/go.mod h1:/wbyibRr2FHMks5tjHJ5F8dMZh3AcwJEMf5vlfC0lxk=
|
||||
github.com/tidwall/gjson v1.14.4 h1:uo0p8EbA09J7RQaflQ1aBRffTR7xedD2bcIVSYxLnkM=
|
||||
github.com/tidwall/gjson v1.14.4/go.mod h1:/wbyibRr2FHMks5tjHJ5F8dMZh3AcwJEMf5vlfC0lxk=
|
||||
github.com/tidwall/match v1.1.1 h1:+Ho715JplO36QYgwN9PGYNhgZvoUSc9X2c80KVTi+GA=
|
||||
github.com/tidwall/match v1.1.1/go.mod h1:eRSPERbgtNPcGhD8UCthc6PmLEQXEWd3PRB5JTxsfmM=
|
||||
github.com/tidwall/pretty v1.2.0/go.mod h1:ITEVvHYasfjBbM0u2Pg8T2nJnzm8xPwvNhhsoaGGjNU=
|
||||
github.com/tidwall/pretty v1.2.1 h1:qjsOFOWWQl+N3RsoF5/ssm1pHmJJwhjlSbZ51I6wMl4=
|
||||
github.com/tidwall/pretty v1.2.1/go.mod h1:ITEVvHYasfjBbM0u2Pg8T2nJnzm8xPwvNhhsoaGGjNU=
|
||||
github.com/tidwall/sjson v1.2.5 h1:kLy8mja+1c9jlljvWTlSazM7cKDRfJuR/bOJhcY5NcY=
|
||||
github.com/tidwall/sjson v1.2.5/go.mod h1:Fvgq9kS/6ociJEDnK0Fk1cpYF4FIW6ZF7LAe+6jwd28=
|
||||
3
public/languages/go/uncloseai/go.mod
Normal file
3
public/languages/go/uncloseai/go.mod
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
module uncloseai.com/uncloseai
|
||||
|
||||
go 1.19
|
||||
Loading…
Add table
Add a link
Reference in a new issue