title: Pointer deference wrapped in parens in go
body: <p>I am learning go coming from JS and trying to wrap my head around pointers.  I understand that if</p>
  <pre><code>type ListNode struct {
      Val  int
      Next *ListNode
  }
  
  a := ListNode{0, null}
  b:= &amp;a
  </code></pre>
  <p>b would be a pointer to the memory location of a and if</p>
  <pre><code>b.Val = 15
  </code></pre>
  <p>then afterwards a.Val is 15.</p>
  <p>I attempted a problem with a linked list, and if l1 represents a pointer to a node in a list, i noticed someone doing this when shifting the pointer.</p>
  <pre><code>l1 = (*l1).Next
  </code></pre>
  <p>but the solution worked if i reformatted them into</p>
  <pre><code>l1 = l1.Next
  </code></pre>
  <p>So it seems that (*l1) is de-referencing the pointer, then re-referencing it again? Am I misinterpreting that? I cannot find any reference to wrapping a deref in parens in the docs or anywhere else online. Thanks for your help</p>