Question: I'd like to work to write Realm from JSON in async in background, but I can't understand why my code isn't work as must. 

```
override func viewDidLoad() {
    super.viewDidLoad()

    myFunc()

}

```

and myFunc():

```
func myFunc() {

        let realm = try! Realm()

        // get file JSON from local device and write data from it to RealmDB
        if realm.isEmpty {

            //local file JSON
            let file = Bundle.main.path(forResource: "file", ofType: "json")!
            let url = URL(fileURLWithPath: file)
            let jsonData = NSData(contentsOf: url)!

            //Serialization JSON
            let json = try! JSONSerialization.jsonObject(with: jsonData as Data, options: [])

            DispatchQueue.main.async {

            realm.beginWrite()

            //Create data from JSON to our objects
            realm.create(DataRoot.self, value: json, update: true)

            try! realm.commitWrite()

            }
        }
    }

```

DB is creating, but next step (as I see) is in error:

```
  override func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {

        return (transport.filter("id == 1").first?.routes.count)!
    }

```

So, I'd like to wait full writing DB in background (show progress view, for example) and go next step.

Answer: 
If you installed Go from a package manager before, you might have an old version. Check `go version` and remove the old version if needed.
For MacPorts users with e.g. go 1.10.3 installed, it didn't seem to be correctly installed for me. The runtime standard packages were missing. I even tried uninstalling and reinstalling a clean copy. So I just removed it and got the official darwin binary package from google:

<https://golang.org/dl/>