Skip to content

Instantly share code, notes, and snippets.

@kamal-kambe
Last active August 1, 2019 06:04
Show Gist options
  • Select an option

  • Save kamal-kambe/58f23be66b22218efcc97e4bb265655a to your computer and use it in GitHub Desktop.

Select an option

Save kamal-kambe/58f23be66b22218efcc97e4bb265655a to your computer and use it in GitHub Desktop.

Revisions

  1. kamal-kambe revised this gist Aug 1, 2019. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion factory.go
    Original file line number Diff line number Diff line change
    @@ -3,7 +3,7 @@ package sql
    import (
    "github.com/jinzhu/gorm"

    "sample-app/service"
    "sample-app/service"
    )

    type storageFactory struct {
  2. kamal-kambe created this gist Aug 1, 2019.
    15 changes: 15 additions & 0 deletions factory.go
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,15 @@
    package sql

    import (
    "github.com/jinzhu/gorm"

    "sample-app/service"
    )

    type storageFactory struct {
    Db *gorm.DB
    }

    func (sf *storageFactory) NewBaseRepository() service.BaseRepository {
    return NewBaseRepository(sf.Db)
    }