FAQ
I wrote a package to track/monitor Go programs using Google Analytics by
going over the documentation and generating most of the code

https://github.com/jpillora/go-ogle-analytics

I have a few questions

    1. GA uses the presence of a property to determine whether it's set or
    not. So for example, with boolean values, there's actually true, false and
    unset. This makes it difficult when coming into Go land since bools must be
    either true or false - there is no unset. Should I *a)* define all
    fields as a string (where the empty string means unset) or should I *b) *define
    setters for every field and maintain a map of set fields (this kind of
    ruins the simple API though)?
    2. Am I using *go generate* correctly? comments?
    3. The repo name is different from the package name (ga), is this Go
    heresy? Should i just use jpillora/ga? It's just not very descriptive...
    4. I'm using two packages in my generation program, is it possible to
    prevent users of this package from auto fetching these? (i.e. is there
    Node.js "devDependencies" in Go?)

Cheers
Jaime


--
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+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Search Discussions

  • Francisco Dalla Rosa Soares at Jan 31, 2015 at 12:50 pm
    1. GA uses the presence of a property to determine whether it's set or
        not. So for example, with boolean values, there's actually true, false and
        unset. This makes it difficult when coming into Go land since bools must be
        either true or false - there is no unset. Should I *a)* define all
        fields as a string (where the empty string means unset) or should I
    *b) *define
        setters for every field and maintain a map of set fields (this kind of
        ruins the simple API though)?

    Take a look at sql's BoolNull and similar types, they could the answer to
    your problem.


    2015年1月31日土曜日、Jaime Pillora<jpillora@gmail.com>さんは書きました:
    I wrote a package to track/monitor Go programs using Google Analytics by
    going over the documentation and generating most of the code

    https://github.com/jpillora/go-ogle-analytics

    I have a few questions

    1. GA uses the presence of a property to determine whether it's set or
    not. So for example, with boolean values, there's actually true, false and
    unset. This makes it difficult when coming into Go land since bools must be
    either true or false - there is no unset. Should I *a)* define all
    fields as a string (where the empty string means unset) or should I *b)
    *define setters for every field and maintain a map of set fields (this
    kind of ruins the simple API though)?
    2. Am I using *go generate* correctly? comments?
    3. The repo name is different from the package name (ga), is this Go
    heresy? Should i just use jpillora/ga? It's just not very descriptive...
    4. I'm using two packages in my generation program, is it possible to
    prevent users of this package from auto fetching these? (i.e. is there
    Node.js "devDependencies" in Go?)

    Cheers
    Jaime


    --
    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+unsubscribe@googlegroups.com
    <javascript:_e(%7B%7D,'cvml','golang-nuts%2bunsubscribe@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+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.
  • Jaime Pillora at Feb 1, 2015 at 5:36 am
    Using Null<Type> structs everywhere would work though it isn't very nice to
    work with.

    I'm currently leaning towards chained setter functions:

    ga.NewEvent().Category("Foo").Action("Bar").Label("Bazz")

    Where NewEvent() creates the empty map of "defined" fields

    On Sat, Jan 31, 2015 at 11:50 PM, Francisco Dalla Rosa Soares wrote:


    1. GA uses the presence of a property to determine whether it's set or
    not. So for example, with boolean values, there's actually true, false and
    unset. This makes it difficult when coming into Go land since bools must be
    either true or false - there is no unset. Should I *a)* define all
    fields as a string (where the empty string means unset) or should I
    *b) *define setters for every field and maintain a map of set fields
    (this kind of ruins the simple API though)?

    Take a look at sql's BoolNull and similar types, they could the answer to
    your problem.


    2015年1月31日土曜日、Jaime Pillora<jpillora@gmail.com>さんは書きました:
    I wrote a package to track/monitor Go programs using Google Analytics by
    going over the documentation and generating most of the code

    https://github.com/jpillora/go-ogle-analytics

    I have a few questions

    1. GA uses the presence of a property to determine whether it's set
    or not. So for example, with boolean values, there's actually true, false
    and unset. This makes it difficult when coming into Go land since bools
    must be either true or false - there is no unset. Should I *a)*
    define all fields as a string (where the empty string means unset) or
    should I *b) *define setters for every field and maintain a map of
    set fields (this kind of ruins the simple API though)?
    2. Am I using *go generate* correctly? comments?
    3. The repo name is different from the package name (ga), is this Go
    heresy? Should i just use jpillora/ga? It's just not very descriptive...
    4. I'm using two packages in my generation program, is it possible to
    prevent users of this package from auto fetching these? (i.e. is there
    Node.js "devDependencies" in Go?)

    Cheers
    Jaime


    --
    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+unsubscribe@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+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupgolang-nuts @
categoriesgo
postedJan 31, '15 at 12:08p
activeFeb 1, '15 at 5:36a
posts3
users2
websitegolang.org

People

Translate

site design / logo © 2021 Grokbase