Hi Freddy!

Those are Struct Tags (see here for more <https://flaviocopes.com/go-tags/>)
and are a way to add some metadata to struct fields that can be accessed
via reflection. Lots of libraries use these to denote names or other notes
about each fields. Those libraries expect to have a "known" struct tag used
so they can parse it. You can see here for a list of "well known" struct
tags <https://github.com/golang/go/wiki/Well-known-struct-tags>, but anyone
can implement any struct tag if they so choose, via reflection
<https://gist.github.com/sosedoff/b373623a9572cf1a992486d2d87dcd85>.

Good luck!
Brian

On Mon, Dec 3, 2018 at 10:01 PM Freddy Martinez <freddy311...@gmail.com>
wrote:

> Hey guys, I’ve been learning Go for the lat couple of weeks but now that
> I’m looking to more advanced topics, I’ve seen things like
>
> type Person struct {
>     FirstName string `db:"first_name"`
>     LastName  string `db:"last_name"`
>     Email     string
> }
>
> What `db:”first_name”` means ?
>
> Regards
>
>
>
> =============================================
> Freddy Martínez García
> Software Engineer
> B.S. Computer Science
> LinkedIn: https://ar.linkedin.com/in/freddy-martinez-garcia-47157259
>
>
> *“If you give someone a program, you will frustrate them for a day;if you
> teach them how to program, yo will frustrate them for a lifetime.”*
>
> *David Leinweber*
>
> --
> You received this message because you are subscribed to the Google Groups
> "golang-nuts" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to golang-nuts+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to