Hacker News new | past | comments | ask | show | jobs | submit login
Gotchas, Irritants and Warts in Go Web Development (braintreepayments.com)
14 points by scapbi on May 13, 2014 | hide | past | favorite | 2 comments



Does anyone else have the problem with nulls? It looks fairly simple, but inserts aren't mentioned here.

From https://code.google.com/p/go-wiki/wiki/SQLInterface

    If a database column is nullable, one of the types supporting null values should
    be passed to Scan.

    For example, if the name column in the names table is nullable:

    var name NullString
    err := db.QueryRow(
        "SELECT name FROM names WHERE id = ?",     id).Scan(&name)
    ...
    if name.Valid {
            // use name.String
    } else {
            // value is NULL
    }


There is nothing in here that should be considered a cautionary tale for someone choosing to go with Golang. If they couldn't fix a race condition then that is too bad. However I do agree that there are too many projects not just in Go but in many other languages where the original authors have sort of abandoned their project or there aren't too many contributors to support for example hypergo which is a client library for Hyperdex.




Consider applying for YC's Fall 2025 batch! Applications are open till Aug 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: