 
       waitsFor ->
         done is true
+
+    it "does not display errors for dependent functions spread across multiple files in the same package", ->
+      done = false
+      runs ->
+        console.log 'Test Directory: ' + directory
+        buffer = editor.getBuffer()
+        secondBuffer = secondEditor.getBuffer()
+        thirdBuffer = thirdEditor.getBuffer()
+        buffer.setText("package main\n\nimport \"fmt\"\nimport \"github.com/testuser/example/util\"\n\nfunc main() {\n\tfmt.Println(\"Hello, world!\")\n\tutil.ProcessString(\"Hello, world!\")\n}")
+        secondBuffer.setText("package util\n\nimport \"fmt\"\n\n// ProcessString processes strings\nfunc ProcessString(text string) {\n\tfmt.Println(\"Processing...\")\n\tfmt.Println(Stringify(\"Testing\"))\n}")
+        thirdBuffer.setText("package util\n\n// Stringify stringifies text\nfunc Stringify(text string) string {\n\treturn text + \"-stringified\"\n}")
+        buffer.save()
+        secondBuffer.save()
+        thirdBuffer.save()
+        dispatch = atom.packages.getLoadedPackage('go-plus').mainModule.dispatch
+        dispatch.on 'dispatch-complete', =>
+          expect(fs.readFileSync(secondFilePath, {encoding: 'utf8'})).toBe "package util\n\nimport \"fmt\"\n\n// ProcessString processes strings\nfunc ProcessString(text string) {\n\tfmt.Println(\"Processing...\")\n\tfmt.Println(Stringify(\"Testing\"))\n}"
+          expect(dispatch.errorCollection?).toBe true
+          expect(_.size(dispatch.errorCollection)).toBe 0
+          done = true
+        secondBuffer.save()
+
+      waitsFor ->
+        done is true

_ = require 'underscore-plus'

describe "build", ->
  [editor, testEditor, directory, filePath, testFilePath] = []

  beforeEach ->
    directory = temp.mkdirSync()

      atom.config.set("go-plus.vetOnSave", false)
      atom.config.set("go-plus.lintOnSave", false)
      atom.config.set("go-plus.goPath", directory)
      atom.config.set("go-plus.environmentOverridesConfiguration", false)
      atom.config.set("go-plus.syntaxCheckOnSave", true)
      atom.config.set("go-plus.goExecutablePath", "/usr/local/go/bin/go")
      atom.config.set("go-plus.gofmtPath", "/usr/local/go/bin/gofmt")
