无法访问在另一个函数中更改的结构字段

I m beginner in go lang. I have created an object array of a struct in function list and pass the address of that object array to another function changelist.In my function changelist i get it as pointer.I wanted to edit some of the fields of passed array object inside this function changedlist and pass it back to the called function list.When i try to access it in my called function i cant access the updated version from the changedlist function.

Here is my code
type Mail struct {
        Name    string
        Address string
        Status  bool
        Error   error
    }
function List(){
          var addressList = make([]Mail,2)
          addressList[0].Name = "Name"
          addressList[0].Address = "Address"
          addressList[1].Name = "Name1"
          addressList[1].Address = "Address"
          newAddress:=changedlist(&addressList)
          fmt.Println(newAddress)
}
function Changedlist(addressList *[]Mail)*[]Mail{
            for _,r:=range *addressList{
                    if r.Name=="Name1"{
                          r.Status=false
                           r.err=errors.New("Error in the name")
                            continue
                        }
                      r.Status=true
                      r.Error=nil
                 }
           return addressList
   }

Here what i was expecting is for name, the status will become true when i get this in my list function.But it is false which is the default value of the bool.This means that the changes are not done to the actual array struct.It is modifying the copied version.Can someone please point me in the right direction how to achieve this..Thanks.

package main

import (
    "errors"
    "fmt"
)

type Mail struct {
    Name    string
    Address string
    Status  bool
    Error   error
}

func List() {
    var addressList = make([]Mail, 2)
    addressList[0].Name = "Name"
    addressList[0].Address = "Address"
    addressList[1].Address = "Address"
    addressList[1].Name = "Name1"
    fmt.Println(addressList)
    newAddress := Changedlist(&addressList)
    fmt.Println(newAddress)
}
func Changedlist(addressList *[]Mail) *[]Mail {
    for k, r := range *addressList {
        if r.Name == "Name1" {
            r.Status = false
            r.Error = errors.New("Error in the name")
            (*addressList)[k] = r
            continue
        }
        r.Status = true
        r.Error = nil
        (*addressList)[k] = r
    }
    return addressList
}

func main() {
    List()
}

// output
[{Name Address false <nil>} {Name1 Address false <nil>}]
&[{Name Address true <nil>} {Name1 Address false Error in the name}]

This is my code, it's not perfect but works correctly.
There are some things you got wrong.

  1. "function" is not a keyword, you should use "func" instead.
  2. You call the function Changedlist with changedlist.
  3. in for loop, the variable r is a copy of the array item, so if you changed it, the array is not affected, I used (*addressList)[k] = r here to change the array. Also, you could modify it with index like (*addressList)[k].Name = xxx without using r

That's all
Hope this can help you ...

https://play.golang.org/p/zAJ5aJpwwA