Skip to content
This repository was archived by the owner on Jan 15, 2024. It is now read-only.

Commit 7905615

Browse files
Magyari Sándor Szilárdinkel
andauthored
Update datasource.go
Co-authored-by: Leandro López <inkel.ar@gmail.com>
1 parent c60a0ba commit 7905615

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

datasource.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -358,12 +358,13 @@ func (c *Client) DataSourceIDByName(name string) (int64, error) {
358358
result := struct {
359359
ID int64 `json:"id"`
360360
}{}
361+
361362
err := c.request("GET", path, nil, nil, &result)
362363
if err != nil {
363-
return result.ID, err
364+
return 0, err
364365
}
365366

366-
return result.ID, err
367+
return result.ID, nil
367368
}
368369

369370
// DataSources returns all data sources as defined in Grafana.

0 commit comments

Comments
 (0)