Code Monkey home page Code Monkey logo

Comments (10)

qhkm avatar qhkm commented on August 20, 2024 1

Glad to got it fixed!! Thanks so much

from alfred-bear.

drgrib avatar drgrib commented on August 20, 2024

Glad you are enjoying the workflow. Unfortunately, this isn't enough context for me to understand what you mean by "run the seach function from cmd line".

from alfred-bear.

drgrib avatar drgrib commented on August 20, 2024

So you mean run the cmd/search/main.go. My guess is you are using go mod? Something about the versioning of the repo or other repos I'm importing doesn't work with mod. I haven't debugged it yet. But I would try it without mod and it might work.

from alfred-bear.

qhkm avatar qhkm commented on August 20, 2024

Thanks for your response! Sorry! My bad for not providing enough context for you to understand what i meant.

Yes, what i meant is i tried to run from cmd/search/main.go. Regarding your question, i guess I did'nt run any go mod init command yet so i think go mod is not setup yet? By the way, go version is 1.12.1 and i dont know if this version of go will search for the gomod anywhere and set it up in the dir.

I also tried to change to go version 1.10.8 (to try to run it without gomod) and run the same command cmd/search/main.go in GOPATH mode but it still returns the query string. I check the code and there's one part that i think might relates to this.

Query method in db/db.go
Screen Shot 2020-05-09 at 16 34 14

From this code above i can see that theres m` variable that stores that map of the column name. I think this is the part that is somehow related.

from alfred-bear.

drgrib avatar drgrib commented on August 20, 2024

I don't think the code has any problems. If that were the case then the workflow itself wouldn't function which obviously isn't the case since I use it every day and it has been downloaded over 200 times.

The issue is almost certainly your Go environment and how you are running it. I definitely won't be changing any code for your local run issues, so I would focus on how you are trying to run it.

from alfred-bear.

qhkm avatar qhkm commented on August 20, 2024

Yeah i think there must be something wrong with my go env. Do you mind to explain how did you run it? Thanks!!

from alfred-bear.

drgrib avatar drgrib commented on August 20, 2024

I'm running go version go1.13.4 darwin/amd64 (macOS). I have a standard GOPATH set up with the project inside it under src/github.com/drgrib/alfred-bear.

To build cmd/search, I cd to the directory and type go build. This creates the executable search which is called by the Bear workflow. It can be run from the command line in its directory using ./search followed by search terms which will create a JSON list of Alfred items matching the query. The same list is used by Alfred in the bs / bsearch script filter.

from alfred-bear.

drgrib avatar drgrib commented on August 20, 2024

I would make sure that you can run standard simple Go programs, create executables from them, and run the executables from the command line before attempting to build the alfred-bear executables. Some sources would be from https://golang.org/ or other Go tutorials.

from alfred-bear.

drgrib avatar drgrib commented on August 20, 2024

Good news: while trying to get go.mod working, I discovered that the package "github.com/mattn/go-sqlite3" I had been using had updated one of its data structures and broken my db code on fresh installs. The only reason my local repo was building the right code was because I had the old version.

Once I merge the branch I'm working on today into master, you should be able to pull the changes and run the code. You were right that the database code was the source of the issue.

from alfred-bear.

drgrib avatar drgrib commented on August 20, 2024

You should be good to go with #23.

from alfred-bear.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.