title: Pros and cons of Go rejecting unused dependencies
body: <p>Google's new language <a href="http://golang.org/" rel="nofollow noreferrer">Go</a> tries to make dependencies management easier by <a href="http://golang.org/doc/go_spec.html#Import_declarations" rel="nofollow noreferrer">explicitly requiring that all dependencies listed in a module actually be used</a>. The compiler will reject a module that declares a dependency to a module without using anything from that module.</p>
  
  <blockquote>
    <p>It is illegal for a package to import itself or to import a package without referring to any of its exported identifiers.</p>
  </blockquote>
  
  <p>I can think of some obvious advantages (e.g. cleaner modules) but maybe there are some non-obvious ones. The only disadvantage I can think of is having an overly pedantic compiler, complaining too much during refactoring, but maybe there are more?</p>
  
  <p>Do you have any experience with other languages enforcing this? What are the pros and cons of this approach?</p>