带2个文件的vsCode golang运行脚本

im pretty new to vsCode and golang. im trying to run using vsCode a script "Main.go" and the script calls for a function in "function.go" that returns an integer

when i run go using command console (go run main.go function.go) there isnt any problem but when i try to run it using vsCode debugger (F5 or ctrl+F5) it wont work.

wanted to know if there's any way to fix it using the launch.json file or settings?

launch.json的内容:注意program哪里写的是文件夹路径

{
    // 使用 IntelliSense 了解相关属性。 
    // 悬停以查看现有属性的描述。
    // 欲了解更多信息,请访问: https://go.microsoft.com/fwlink/?linkid=830387
    "version": "0.2.0",
    "configurations": [
        {
            "name": "testGO",
            "type": "go",
            "request": "launch",
            "mode": "auto",
            "program": "${workspaceFolder}",
            "env": {},
            "args": []
        }
    ]
}

下面是tasks.json,args那里写"."

{
    // See https://go.microsoft.com/fwlink/?LinkId=733558
    // for the documentation about the tasks.json format
    "version": "2.0.0",
    "tasks": [
        {
            "label": "gotest",
            "type": "shell",
            "command": "go",
            "args": [
                "build",
                ".",
            ],
            "group": {
                "kind": "build",
                "isDefault": true
            }
        }
    ]
}