title: Initialize a new class in Golang (Convert Java to Golang)
body: <p>I am trying to convert this java to golang and now I have this bug. I don't know why this bug is showing up.</p>
  
  <p>here is the java code:</p>
  
  <pre><code>ArrayList&lt;Cell&gt; path; // path does not repeat first cell
  String name;
  static int count = 0;
  
  public Path() {
    this.path = new ArrayList&lt;&gt;();
    this.name = "P" + (++this.count);
  }
  
  public Path(Path op) {
    this.path = new ArrayList&lt;&gt;();
    this.name = op.name;
    path.addAll((op.path));
  }
  </code></pre>
  
  <p>Here is what i wrote </p>
  
  <pre><code>type Path struct {
      name  string
      count int
      path  []Cell
  }
  
  func NewPath() (p *Path) {
      p = new(Path)
      p.path = []Cell{}
      p.count = 0
      p.name = "P" + strconv.Itoa(1+p.count)
      return
  }
  
  func NewPath(op Path) (p *Path) {
      p = new(Path)
      p.path = []Cell{}
      p.count = 0
      p.name = op.name
      p.path = append(p.path, op.path)
      return
  }
  </code></pre>
  
  <p>The go system said I am wrong in term of redeclaring NewPath, with the error:</p>
  
  <pre><code>prog.go:21:6: NewPath redeclared in this block
  </code></pre>
  
  <p>How can I debug it? </p>