file1
func loopFunc() {
m := make(map[int]net.Conn)
for i := 1; i < 10000; i++ {
c, err := l.Accept()
if err != nil {
fmt.Println(err)
return
}
m[i] = c
}
iWantMaps(m)
}
file2 doesn't exist yet, but a random assigning to a value from the map will do as an example
func iWantMaps(m) {
something := m[1]
}
This is my project structure:
+/pkg
+-->file1
+-->file2
Consider a for loop that constantly updates a map in file1. I'm trying to either:
- transfer the whole map from file1 to a function in file2
- be able to retrieve keys and values from the map in file1 from a function in file2.