There is a detailed article available on how you can write workflows in Go language.
My workflow in developing workflows
I like to write all my workflows in Go language unless the workflow can be done using only Alfred builtin objects and some python/bash code.
Workflows in Go language
In cases where I am planning to use Go to write the workflow. Here are the steps I follow. This assumes you have installed alfred cli tool.
- Create a folder in my GOPATH inside
- prefix the folder name with
- initialise the folder with git as any project
- inside my
alfred-folder I create a
- this is where the actual workflow will live in as well as the binary file compiled from my Go code
- create the workflow I want to make in alfred preferences
- add the icon, name and unique bundle id
- carry the info.plist and .png file of the logo to this workflow directory I created
- I use Alfred's Move To... file action for quickly transferring files
- you can find these files by going here
- After transferring the files, I delete the workflow from Alfred preferences
- Inside my
alfred-directory I run
- that creates a symlink between the workflow directory and where the actual workflow lies
- write my Go code inside
alfred-folder and when I want to compile it to run from Alfred, I run