Skip to content

Commit 28b8a3f

Browse files
authored
Small changes in code examples
1 parent 53575ee commit 28b8a3f

File tree

1 file changed

+6
-15
lines changed
  • docs/integrations/language-clients/go

1 file changed

+6
-15
lines changed

docs/integrations/language-clients/go/index.md

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -47,27 +47,21 @@ import (
4747
func main() {
4848
conn, err := connect()
4949
if err != nil {
50-
panic((err))
50+
panic(err)
5151
}
5252

5353
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")
5555
if err != nil {
5656
log.Fatal(err)
5757
}
5858

5959
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 {
6762
log.Fatal(err)
6863
}
69-
log.Printf("name: %s, uuid: %s",
70-
name, uuid)
64+
log.Printf("name: %s, uuid: %s", name, uuid)
7165
}
7266

7367
}
@@ -90,7 +84,6 @@ func connect() (driver.Conn, error) {
9084
{Name: "an-example-go-client", Version: "0.1"},
9185
},
9286
},
93-
9487
Debugf: func(format string, v ...interface{}) {
9588
fmt.Printf(format, v)
9689
},
@@ -437,9 +430,7 @@ conn, err := clickhouse.Open(&clickhouse.Options{
437430
if err != nil {
438431
return err
439432
}
440-
if err != nil {
441-
return err
442-
}
433+
443434
v, err := conn.ServerVersion()
444435
```
445436
[Full Example](https://github.com/ClickHouse/clickhouse-go/blob/main/examples/clickhouse_api/auth.go)

0 commit comments

Comments
 (0)