Skip to content

Setting up hover to use a home made version of 'go flutter'

Pierre Champion | Drakirus edited this page Apr 13, 2020 · 6 revisions

Work on 'go-flutter' source code

If you want to work on the 'go-flutter' source code and try your change in a hover project, you must:

  • clone the 'go-flutter' repo.
    git clone https://github.com/go-flutter-desktop/go-flutter
    cd go-flutter
    pwd => /tmp/go-flutter in my case.

  • On your 'hover' test project, you must tell the golang tool-chain to use the /tmp/go-flutter path instead of the release available in github.
    Place the following replace directive in go/go.mod:

    replace github.com/go-flutter-desktop/go-flutter => /tmp/go-flutter
    
  • Apply modification to /tmp/go-flutter

You're all setup to work on 'go-flutter' source code! 🎊

Linting

As 'go-flutter' uses the flutter/engine shared library, the linting tool might fail because the tool doesn't find the shared library.

$ go vet .
# github.com/go-flutter-desktop/go-flutter/embedder
/usr/sbin/ld: cannot find -lflutter_engine
collect2: error: ld returned 1 exit status

To solve the problem, you have to set the env variable CGO_LDFLAGS to the engine cache path.

On my machine it's:

export CGO_LDFLAGS="-L/home/drakirus/.cache/hover/engine/linux/"