# Struct Constructor

**URL:** <https://forum.golangbridge.org/t/struct-constructor/11543>\
**Category:** Getting Help\
**Created:** [November 26, 2018, 11:39am UTC](https://forum.golangbridge.org/t/struct-constructor/11543 "2018-11-26T11:39:10Z")\
**Posts on this page:** 1\
**Showing post:** 6

<div class="post-metadata">

**Author:** ![imatmati](https://forum.golangbridge.org/user_avatar/forum.golangbridge.org/imatmati/32/4187_2.png) [@imatmati](https://forum.golangbridge.org/u/imatmati)\
**Post date:** [November 28, 2018, 9:44am UTC](https://forum.golangbridge.org/t/struct-constructor/11543/6 "2018-11-28T09:44:06Z")

</div>

Hi,

No, it’s not correct. You create a struct function then you call it by referencing through the struct itself and pass it a Etc object to fulfill the receiver parameter !! Why would you pass a Etc object to generate one without using it ?  
The correct way would be :

```
package main

import (
   "fmt"
)

type Etc struct {
   Foo string
   Bar int
}

func Make(foo string, bar int) Etc {
   return Etc{
  	  Foo: foo,
	  Bar: bar,
   }
}
func main() {
    fmt.Printf("%#+v\n", Make("foo_string", 0xbeef))
}

```

Have a nice day.

---

_[View the full topic](https://forum.golangbridge.org/t/struct-constructor/11543)._
