Skip to content

Use CompileDaemon with go generate? #67

Open
@jameshochadel

Description

@jameshochadel

I'm trying to use CompileDaemon with go generate, but have not been successful. I am running two instances of CompileDaemon to try accomplishing this. One instances watches the source files, which are .sql, and runs go generate when they change. The other watches all .go source files and runs go build. I believe my flags are set up so that the two are watching mutually exclusive files:

#!/bin/sh

CompileDaemon -build="go generate ./..."
  -exclude="*.go"
  -include="*.sql"
  -pattern=".+\.sql$" &
CompileDaemon -build="go build -o /opt/bin/service"
  -exclude="*.sql"
  -include="*.go"
  -pattern=".+\.go$" &

However, when I run this script, CompileDaemon gets stuck in an infinite loop. Is CompileDaemon incompatible with go generate?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions