therecipe / qt

Qt binding for Go (Golang) with support for Windows / macOS / Linux / FreeBSD / Android / iOS / Sailfish OS / Raspberry Pi / AsteroidOS / Ubuntu Touch / JavaScript / WebAssembly
GNU Lesser General Public License v3.0
10.5k stars 748 forks source link

qtmoc copies all imports #1259

Open stevewlrls opened 2 years ago

stevewlrls commented 2 years ago

Using go 1.17 and "per module" install of the Qt binding, qtmoc seems to copy all imports into the moc.go file. Test case:

  1. Start with the advanced example for QTableView in a new folder (using Mac Monterey but that's probably not significant).
  2. Do 'go mod init tableview' (for example).
  3. Follow "per module" install instructions for Qt binding.
  4. Try "qtdeploy build" ... Go compiler reports ./moc.go:9:2: imported and not used: "os"

Build is successful if Qt binding is installed globally (GO111MODULE=off) and qtdeploy is also invoked with per module support turned off.