commenting exported vars/funcs and blank imports

This commit is contained in:
nicksherron 2020-02-10 01:53:37 -05:00
parent f13c5beb73
commit 7b16271dbe
4 changed files with 15 additions and 4 deletions

View file

@ -51,7 +51,7 @@ Flags:
Use " [command] --help" for more information about a command.
```
### Running
Just run the server
```shell script
@ -65,4 +65,9 @@ docker run -d -p 8080:8080 --name bashhub-server nicksherron/bashhub-server
```
Then add ```export BH_HOST=localhost:8080``` (or whatever you set your bashhub-server address to) to your .zshrc or .bashrc
Thats it!
Thats it! Restart your shell with `$SHELL` then re-configure bashhub-client to use your new
server by re-running ```bashhub setup``` .
### Setting DB
### Using Regex

View file

@ -39,7 +39,7 @@ var rootCmd = &cobra.Command{
internal.Run()
},
}
// Execute runs root command
func Execute() {
if err := rootCmd.Execute(); err != nil {
fmt.Println(err)

View file

@ -27,8 +27,11 @@ import (
"time"
"github.com/jinzhu/gorm"
// db driver are called by gorm
_ "github.com/jinzhu/gorm/dialects/postgres"
// db driver are called by gorm
_ "github.com/jinzhu/gorm/dialects/sqlite"
// db driver are called by database/sql
_ "github.com/lib/pq"
"github.com/mattn/go-sqlite3"
"golang.org/x/crypto/bcrypt"
@ -47,6 +50,7 @@ func dbInit() {
var err error
if strings.HasPrefix(DbPath, "postgres://") {
// postgres
db, err = sql.Open("postgres", DbPath)
if err != nil {
log.Fatal(err)

View file

@ -81,7 +81,9 @@ type System struct {
}
var (
// Addr is the listen and server address for our server (gin)
Addr string
// LogFile is the log file location for http logging. Default is stderr.
LogFile string
)
@ -107,7 +109,7 @@ func loggerWithFormatterWriter(f gin.LogFormatter) gin.HandlerFunc {
Output: getLog(),
})
}
// Run starts server
func Run() {
// Initialize backend
dbInit()