File tree Expand file tree Collapse file tree 1 file changed +6
-15
lines changed
docs/integrations/language-clients/go Expand file tree Collapse file tree 1 file changed +6
-15
lines changed Original file line number Diff line number Diff line change @@ -47,27 +47,21 @@ import (
47
47
func main () {
48
48
conn , err := connect ()
49
49
if err != nil {
50
- panic (( err) )
50
+ panic (err)
51
51
}
52
52
53
53
ctx := context.Background ()
54
- rows , err := conn.Query (ctx, " SELECT name,toString(uuid) as uuid_str FROM system.tables LIMIT 5" )
54
+ rows , err := conn.Query (ctx, " SELECT name, toString(uuid) as uuid_str FROM system.tables LIMIT 5" )
55
55
if err != nil {
56
56
log.Fatal (err)
57
57
}
58
58
59
59
for rows.Next () {
60
- var (
61
- name, uuid string
62
- )
63
- if err := rows.Scan (
64
- &name,
65
- &uuid,
66
- ); err != nil {
60
+ var name , uuid string
61
+ if err := rows.Scan (&name, &uuid); err != nil {
67
62
log.Fatal (err)
68
63
}
69
- log.Printf (" name: %s , uuid: %s " ,
70
- name, uuid)
64
+ log.Printf (" name: %s , uuid: %s " , name, uuid)
71
65
}
72
66
73
67
}
@@ -90,7 +84,6 @@ func connect() (driver.Conn, error) {
90
84
{Name: " an-example-go-client" , Version: " 0.1" },
91
85
},
92
86
},
93
-
94
87
Debugf: func (format string , v ...interface {}) {
95
88
fmt.Printf (format, v)
96
89
},
@@ -437,9 +430,7 @@ conn, err := clickhouse.Open(&clickhouse.Options{
437
430
if err != nil {
438
431
return err
439
432
}
440
- if err != nil {
441
- return err
442
- }
433
+
443
434
v , err := conn.ServerVersion ()
444
435
` ` `
445
436
[Full Example](https://github.com/ClickHouse/clickhouse-go/blob/main/examples/clickhouse_api/auth.go)
You can’t perform that action at this time.
0 commit comments