DEV Community

Discussion on: How to parse Time in GOLANG work with SQL.

Collapse
 
pratikgchaudhari profile image
Pratik Chaudhari

Great post @rahulkarmore

Here's a tip for leveraging the 'syntax highlighting' in your posts:

You can specify the name of the language in your 'code block', like so:


 ```golang
    func DbConn() (db *sql.DB) {

        db, err := sql.Open("mysql", "root:root@tcp(127.0.0.1:3306)/new_lms")
        if err != nil {
            panic(err.Error())
        }
        return db
    }
```

 

Here's how your code will look after you specify the name of the programming language:

func DbConn() (db *sql.DB) {

    db, err := sql.Open("mysql", "root:root@tcp(127.0.0.1:3306)/new_lms")
    if err != nil {
        panic(err.Error())
    }
    return db
}
Enter fullscreen mode Exit fullscreen mode

Looks beautiful, doesn't it?

Collapse
 
rahulkarmore profile image
Rahul Karmore

its looks great, Thank you so much Pratik sir for your helping hand.