title: Embedding structs in golang gives error "unknown field"
body: <p>i have a <code>struct</code> in <code>user</code> package called <code>account</code></p>
  
  <pre><code>type Account struct {
      Tp          string `json:"type"bson:"type"`
      AccountId   string  `json:"account_id"bson:"account_id"`
      Credentials map[string]interface{} `json:"credentials,omitempty"bson:"credentials,omitempty"`
      ProfilePicture string `json:"profile_picture,omitempty"`
      Username string `json:"username"bson:"username"`
      AccessToken map[string]interface{}`bson:"access_token,omitempty"`
  }
  </code></pre>
  
  <p>and in <code>user/accounts</code> im trying to embed this account struct into another struct</p>
  
  <pre><code>type returnAccount struct {
      user.Account
      AccessToken string `json:"access_token,omitempty"`
  }
  </code></pre>
  
  <p>user package is properly imported before trying to embed i was using it successfully</p>
  
  <p>finaly in a loop i am getting user accounts and making a map of <code>returnAccount</code> and returning from my function 
  here is my function </p>
  
  <pre><code>func getAccounts(usr *user.AuthenticatedUser, id ...string) (accounts map[string]returnAccount) {
      accounts = make(map[string]returnAccount)
      if len(id) &gt; 0 {
          for _, v := range id {
              for _, acnt := range usr.Accounts {
                  if acnt.AccountId == v {
                      accounts[acnt.AccountId] = returnAccount{
                          Tp:       acnt.Tp,
                          AccountId:acnt.AccountId,
                      }
                  }
              }
          }
          return
      }
      for _, v := range usr.Accounts {
          accounts[v.AccountId] = returnAccount{
              Tp:       v.Tp,
              AccountId:v.AccountId,
              Username: v.Username,
  
          }
  
      }
      return
  }
  </code></pre>
  
  <p>However this code wont compile here is the error message</p>
  
  <pre><code># sgin/api/user/accounts
  api/user/accounts/getaccounts.go:16: unknown returnAccount field 'Tp' in struct literal
  api/user/accounts/getaccounts.go:17: unknown returnAccount field 'AccountId' in struct literal
  api/user/accounts/getaccounts.go:26: unknown returnAccount field 'Tp' in struct literal
  api/user/accounts/getaccounts.go:27: unknown returnAccount field 'AccountId' in struct literal
  api/user/accounts/getaccounts.go:28: unknown returnAccount field 'Username' in struct literal
  </code></pre>
  
  <p>everything seems pretty straightforward and simple i cannot figure out why i get this error all members i need to reach of the Account struct are exported </p>
  
  <p>The reason why i need this field is i want to send access token to clients through api but not the secret and also i want to reduce the indention level</p>