You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: 0322.go
    path of file: ./repos/Leetcode/src/0322-Coin-Change
    
    the code of the file until where you have to start completion: var res int64

func coinChange(coins []int, amount int) int {
    sort.Ints(coins)
    res = int
    
func coinChange(coins []int, amount int) int {
    sort.Ints(coins)
    res = int64(amount) + 1

    dfs(coins, len(coins) - 1, int64(amount), 0)
    if res > int64(amount) {
        return -1
    }
    return int(res)
}