Fix golint warnings (#189)

* Fix goling warnings

Signed-off-by: Dejan Mijic <dejan@mainflux.com>

* Bump version to 0.1.2

Signed-off-by: Dejan Mijic <dejan@mainflux.com>
This commit is contained in:
Dejan Mijić 2018-03-16 14:06:12 +01:00 committed by Nikola Marčetić
parent bf5d1544b6
commit e42d422410
5 changed files with 8 additions and 10 deletions

View File

@ -2,7 +2,7 @@ package postgres
import (
"github.com/jinzhu/gorm"
_ "github.com/jinzhu/gorm/dialects/postgres"
_ "github.com/jinzhu/gorm/dialects/postgres" // required by GORM
"github.com/mainflux/mainflux/manager"
uuid "github.com/satori/go.uuid"
)
@ -13,6 +13,8 @@ type channelRepository struct {
db *gorm.DB
}
// NewChannelRepository instantiates a PostgreSQL implementation of channel
// repository.
func NewChannelRepository(db *gorm.DB) manager.ChannelRepository {
return &channelRepository{db}
}

View File

@ -2,7 +2,7 @@ package postgres
import (
"github.com/jinzhu/gorm"
_ "github.com/jinzhu/gorm/dialects/postgres"
_ "github.com/jinzhu/gorm/dialects/postgres" // required by GORM
"github.com/mainflux/mainflux/manager"
uuid "github.com/satori/go.uuid"
)
@ -24,11 +24,7 @@ func (cr *clientRepository) Id() string {
}
func (cr *clientRepository) Save(client manager.Client) error {
if err := cr.db.Create(&client).Error; err != nil {
return err
}
return nil
return cr.db.Create(&client).Error
}
func (cr *clientRepository) Update(client manager.Client) error {

View File

@ -4,7 +4,7 @@ import (
"fmt"
"github.com/jinzhu/gorm"
_ "github.com/jinzhu/gorm/dialects/postgres"
_ "github.com/jinzhu/gorm/dialects/postgres" // required by GORM
"github.com/mainflux/mainflux/manager"
)

View File

@ -2,7 +2,7 @@ package postgres
import (
"github.com/jinzhu/gorm"
_ "github.com/jinzhu/gorm/dialects/postgres"
_ "github.com/jinzhu/gorm/dialects/postgres" // required by GORM
"github.com/lib/pq"
"github.com/mainflux/mainflux/manager"
)

View File

@ -5,7 +5,7 @@ import (
"net/http"
)
const version string = "0.1.1"
const version string = "0.1.2"
type response struct {
Version string