在具有 int 参数的函数中未定义传入的 int (Golang)

Incoming int is undefned in a function that has int parameter (Golang)

我正在尝试在 Golang 的链表中插入第一项。

由于某些原因,我定义为传入参数的int未定义。当我在 Go Playground 中 运行 以下代码时,我得到:

./prog.go:15:36:未定义:值

./prog.go:16:11:未定义:值

package main

import (
    "fmt"
)


// Definition for singly-linked list.
type ListNode struct {
    Val  int
    Next *ListNode
}

func insert_first (LL ListNode, int Value) *ListNode {
   LL.Val = Value
   LL.Next = nil
   return &LL
}


func main() {

    var foo_list *ListNode
    
    foo_list = insert_first (foo_list, 300)

    fmt.Println(foo_list.Val, foo_list.Next)

}

在 Go 中,类型在变量名之后。

func insert_first (LL ListNode, int Value) *ListNode {

应该是

func insert_first (LL ListNode, Value int) *ListNode {