Comments (6)
The functions do not need to be exported because they are used by the same package (main) where they are defined. The application builds fine:
$ git clone [email protected]:blevesearch/beer-search.git
Cloning into 'beer-search'...
remote: Enumerating objects: 4, done.
remote: Counting objects: 100% (4/4), done.
remote: Compressing objects: 100% (3/3), done.
remote: Total 7463 (delta 1), reused 3 (delta 1), pack-reused 7459
Receiving objects: 100% (7463/7463), 2.12 MiB | 25.28 MiB/s, done.
Resolving deltas: 100% (2902/2902), done.
$ cd beer-search
$ ls
data go.mod go.sum http_util.go main.go main_test.go mapping_example1.go mapping_example2.go mapping.go README.md static
$ go build
$ ./beer-search
2020/10/05 11:47:25 GOMAXPROCS: 32
2020/10/05 11:47:25 Creating new index...
2020/10/05 11:47:25 Listening on :8094
2020/10/05 11:47:25 Indexing...
2020/10/05 11:47:26 Indexed 1000 documents, in 1.08s (average 1.08ms/doc)
^C
It appears maybe you are attempting to simply run the main.go, but that is not supported:
$ go run main.go
# command-line-arguments
./main.go:57:24: undefined: buildIndexMapping
./main.go:89:12: undefined: staticFileRouter
./main.go:99:29: undefined: docIDLookup
from beer-search.
Thank you for your prompt reply!
go build
does work fine.
Might I suggest then, that you update the README to indicate that this example is meant to be built and then run from the executable?
from beer-search.
Can you help me understand why you expected go run main.go
to work? In my experience that never works for real applications, as they typically grow beyond a single file, and typing go run file1.go file2.go file3.go etc
becomes unwieldy.
from beer-search.
from beer-search.
That would not be accurate either, it does work using go run
, you just have to use it correctly:
$ go run main.go http_util.go mapping.go
2020/10/05 12:14:56 GOMAXPROCS: 32
2020/10/05 12:14:56 Opening existing index...
2020/10/05 12:14:56 Listening on :8094
^Csignal: interrupt
When using go run
you have supply all the required file names.
from beer-search.
from beer-search.
Related Issues (10)
- Edge NGram unexpected output HOT 9
- how does searching via edgengram work
- Cannot build on mac
- error when starting no analyzer with name or type 'en' registered HOT 1
- the alternate mapping examples are broken
- review + encoding in queries
- Index size 100 X the size of the original data set HOT 5
- MultiPhraseQuery query issue
- Query questions
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from beer-search.