```
func twoSum(nums []int, target int) []int {
hash := make(map[int]int)
var res []int
for i := 0;i < len(nums); i += 1 {
toFind := target - nums[i]
f, notFound := hash[toFind]
if notFound != false {
res = append(res, f)
res = append(res, i)
return res
}
hash[nums[i]] = i
}
return res
}
```