FAQ
Let's start with the code:

package main

import (
"fmt"

directory "google.golang.org/api/admin/directory_v1"
)

func main() {
u := &directory.User{}
u.CustomSchemas = map[string]directory.UserCustomProperties{
"dashermaker": map[string]string{
"ns": "mynamespace",
},
}
fmt.Println(u)
}

On both of my computers (one Mac, one Ubuntu, both running go 1.4.2) I get
the following error:
cannot use map[string]string literal (type map[string]string) as type
admin.UserCustomProperties in map value

However I had a few co-workers run this on their machines and no error at
all. What in my environment could be causing this to go wrong?

--
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

  • Tolar Jeffrey at Jul 21, 2015 at 3:05 am
    Looks like it changed from a struct{} to an interface{} back in May [1];
    you probably have an old version.

    [1]: https://github.com/google/google-api-go-client/commit/be882d4ca533f0337987b928b23b47150bf7179a#diff-91f44d6da114f5a01efc1b960b767c4f
    On Monday, July 20, 2015 at 7:10:26 PM UTC-5, sams...@google.com wrote:

    Let's start with the code:

    package main

    import (
    "fmt"

    directory "google.golang.org/api/admin/directory_v1"
    )

    func main() {
    u := &directory.User{}
    u.CustomSchemas = map[string]directory.UserCustomProperties{
    "dashermaker": map[string]string{
    "ns": "mynamespace",
    },
    }
    fmt.Println(u)
    }

    On both of my computers (one Mac, one Ubuntu, both running go 1.4.2) I get
    the following error:
    cannot use map[string]string literal (type map[string]string) as type
    admin.UserCustomProperties in map value

    However I had a few co-workers run this on their machines and no error at
    all. What in my environment could be causing this to go wrong?
    --
    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.
  • Samuel Stern at Jul 21, 2015 at 5:21 pm
    That was it, thanks!
    On Mon, Jul 20, 2015 at 7:47 PM wrote:

    Looks like it changed from a struct{} to an interface{} back in May [1];
    you probably have an old version.

    [1]:
    https://github.com/google/google-api-go-client/commit/be882d4ca533f0337987b928b23b47150bf7179a#diff-91f44d6da114f5a01efc1b960b767c4f

    On Monday, July 20, 2015 at 7:10:26 PM UTC-5, sams...@google.com wrote:

    Let's start with the code:

    package main

    import (
    "fmt"

    directory "google.golang.org/api/admin/directory_v1"
    )

    func main() {
    u := &directory.User{}
    u.CustomSchemas = map[string]directory.UserCustomProperties{
    "dashermaker": map[string]string{
    "ns": "mynamespace",
    },
    }
    fmt.Println(u)
    }

    On both of my computers (one Mac, one Ubuntu, both running go 1.4.2) I
    get the following error:
    cannot use map[string]string literal (type map[string]string) as type
    admin.UserCustomProperties in map value

    However I had a few co-workers run this on their machines and no error at
    all. What in my environment could be causing this to go wrong?
    --
    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
postedJul 21, '15 at 12:10a
activeJul 21, '15 at 5:21p
posts3
users2
websitegolang.org

2 users in discussion

Samuel Stern: 2 posts Tolar Jeffrey: 1 post

People

Translate

site design / logo © 2021 Grokbase