go测试用例不在主程序包中运行

I'm trying to write a simple test to get a better understanding of golang testing but the test case doesn't seem to execute and I'm expecting it to fail.

In my main.go I have:

package main

import "fmt"

func main() {

    fmt.Println("run")

}

func twoSum(nums []int, target int) []int {
    lookup := make(map[int]int)
    for i, n := range nums {
        c := target - n
        if j, ok := lookup[c]; ok {
            return []int{j, i}
        }
        lookup[n] = i
    }
    return []int{}

}

and then in my main_test.go I have this:

package main

import (
    "reflect"
    "testing"
)

var twoSumsCases = []struct{
    input []int
    target int
    expected []int

} {
    {
         []int{2,7,11,15},
         9,
         []int{0,3},

    },
}

func TesttwoSum(t *testing.T) {

    for _, tc := range twoSumsCases {
        actual := twoSum(tc.input, tc.target)

        eq := reflect.DeepEqual(actual, tc.expected)

        if eq {
            t.Log("expected: ", tc.expected, " actual: ", actual)
        } else {
            t.Error("expected: ", tc.expected, " actual: ", actual)

        }
    }
}

then when I run go test -v...it tells me that testing: warning: no tests to run. I looked at this as an example: https://blog.alexellis.io/golang-writing-unit-tests/...and I think i got everything I need to but not sure why the test isn't executing.

Change the name of the test function to TestTwoSum. This name matches the pattern described in first paragraph of the testing package documentation:

... It is intended to be used in concert with the “go test” command, which automates execution of any function of the form

func TestXxx(*testing.T)

where Xxx does not start with a lowercase letter. ...

Try renaming the test function to this:

func TestTwoSum(t *testing.T) {

Golang tests are pretty case sensitive. The test functions need to be named using Pascal Case starting with "Test" so the go test tool can discover it.