Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed 4 days ago.
Improve this question
go file
package main
import "fmt"
var context = "helloWrold"
func main() {
fmt.Println(context)
}
Go version 1.19
➜ test git:(master) ✗ /usr/local/opt/go#1.19/bin/go run test.go
# runtime
/usr/local/Cellar/go/1.19.5/libexec/src/runtime/panic.go:1143:1: syntax error: non-declaration statement outside function body
/usr/local/Cellar/go/1.19.5/libexec/src/runtime/panic.go:1150:2: syntax error: non-declaration statement outside function body
/usr/local/Cellar/go/1.19.5/libexec/src/runtime/panic.go:1150:21: method has no receiver
/usr/local/Cellar/go/1.19.5/libexec/src/runtime/panic.go:1173:21: method has no receiver
/usr/local/Cellar/go/1.19.5/libexec/src/runtime/panic.go:1173:21: syntax error: unexpected {, expecting name or (
Go version 1.17
➜ test git:(master) ✗ /usr/local/opt/go#1.17/bin/go run test.go
helloWrold
➜ test git:(master) ✗
why go1.17 can run success ,but 1.19 can't ;
Related
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 7 months ago.
Improve this question
I'm trying to install a github file through bash following these instructions
https://github.com/allenai/s2orc-doc2json
bash scripts/setup_grobid.sh
but I'm getting the following error
bash scripts/setup_grobid.sh
SYSTEM_WGETRC = c:/progra~1/wget/etc/wgetrc
syswgetrc = c:/progra~1/wget/etc/wgetrc
--2022-07-21 20:55:25-- https://github.com/kermitt2/grobid/archive/0.6.1.zip
Resolving github.com... 140.82.121.4
Connecting to github.com|140.82.121.4|:443... connected.
OpenSSL: error:1407742E:SSL routines:SSL23_GET_SERVER_HELLO:tlsv1 alert protocol version
Unable to establish SSL connection.
unzip: cannot find or open 0.6.1.zip, 0.6.1.zip.zip or 0.6.1.zip.ZIP.
rm: cannot remove '0.6.1.zip': No such file or directory
scripts/setup_grobid.sh: line 11: cd: /c/Users/User/grobid-0.6.1: No such file or directory
scripts/setup_grobid.sh: line 12: ./gradlew: No such file or directory
cp: cannot stat '/c/Users/User/git/s2orc-pdf2json/pdf2json/grobid/config.yaml': No such file or directory
cp: cannot stat '/c/Users/User/git/s2orc-pdf2json/pdf2json/grobid/grobid.properties': No such file or directory
scripts/setup_grobid.sh: line 22: ./gradlew: No such file or directory
This is the setup_grobid.sh after running it through ShellCheck.net
#!/usr/bin/env bash
# put in your pdf2json directory here
export PDF2JSON_HOME=$HOME/Desktop/s2orc-doc2json-main
# Download Grobid
cd "$HOME" || exit
wget https://github.com/kermitt2/grobid/archive/0.6.1.zip
unzip 0.6.1.zip
rm 0.6.1.zip
cd "$HOME"/Desktop/s2orc-doc2json-main/grobid-0.6.1 || exit
./gradlew clean install
## Grobid configurations
# increase max.connections to slightly more than number of processes
# decrease logging level
# this isn't necessary but is nice to have if you are processing lots of files
cp "$PDF2JSON_HOME"/pdf2json/grobid/config.yaml "$HOME"/grobid-0.6.1/grobid-service/config/config.yaml
cp "$PDF2JSON_HOME"/pdf2json/grobid/grobid.properties "$HOME"/grobid-0.6.1/grobid-home/config/grobid.properties
## Start Grobid
./gradlew run
I even tried to --no-check-certificate but still got the same error.
edit: I'm using Wget 1.11.4 / OpenSSL 1.1.1q 5 Jul 2022
Telling by
OpenSSL: error:1407742E:SSL routines:SSL23_GET_SERVER_HELLO:tlsv1 alert protocol version
this might be caused by github droping support for ancient TLS version protocols https://github.blog/2018-02-01-crypto-removal-notice/ and a fairly outdated wget+openssl installation.
Try forcing a specific modern TLS protocol and see how it goes
wget --secure-protocol=TLSv1_2 https://github.com/kermitt2/grobid/archive/0.6.1.zip
or try to upgrade your installation
As a rule of thumb, start your scripts with
set -ex
So that they
stop if any instruction fails
echo the instruction that is being executed
Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 2 years ago.
The community reviewed whether to reopen this question 8 months ago and left it closed:
Original close reason(s) were not resolved
Improve this question
I already installed all neccessary libraries it couldn't found (libxslt-dev, libxml2-dev), specified -- --with-xml2-include=/usr/include/libxml2 --use-system-libraries, but it still fails with
make "DESTDIR=" install
make: /usr/bin/mkdir: Command not found
make: *** [Makefile:202: .sitearchdir.-.nokogiri.time] Error 127
sudo ln -s /bin/mkdir /usr/bin/mkdir
Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed 2 years ago.
Improve this question
I am running Ubuntu 18.04. I had rust already installed using the instructions at rustup.rs in my /home/username/.cargo directory. When trying to install deno with:
cargo insall deno
towards the end of the process the build fails with the error:
Compiling deno_core v0.47.0
error[E0599]: no method named `map_or` found for type `std::result::Result<&url::Url, &rusty_v8::data::TryFromTypeError>` in the current scope
--> /home/kaan.atakan/.cargo/registry/src/github.com-1ecc6299db9ec823/deno_core-0.47.0/bindings.rs:569:41
|
569 | v8::String::new(scope, url.as_ref().map_or("<unknown>", Url::as_str))
| ^^^^^^ help: there is a method with a similar name: `map_err`
error: aborting due to previous error
For more information about this error, try `rustc --explain E0599`.
error: could not compile `deno_core`.
warning: build failed, waiting for other jobs to finish...
error: failed to compile `deno v1.0.4`, intermediate artifacts can be found at `/tmp/cargo-installuTtprd`
Caused by:
build failed
Doh! It turns out my rust installation was out of date. I updated it by typing rustup update in to the terminal and after the update was finished I ran cargo install deno again and everything worked!
Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 2 years ago.
Improve this question
dpkg: error processing archive /var/cache/apt/archives/ruby-progressbar_1.10.1-1_all.deb (--unpack):
trying to overwrite '/usr/lib/ruby/vendor_ruby/ruby-progressbar/base.rb', which is also in package ruby-ruby-progressbar 1.6.0-0kali1
Errors were encountered while processing:
/var/cache/apt/archives/ruby-progressbar_1.10.1-1_all.deb
Scanning application launchers
Updating active launchers
Done
E: Sub-process /usr/bin/dpkg returned an error code (1)
Try the below:
dpkg -i --force-overwrite /var/cache/apt/archives/ruby-progressbar_1.10.1-1_all.deb
apt --fix-broken -f install
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about programming within the scope defined in the help center.
Closed 3 years ago.
Improve this question
I have set up travis build for my Github project Captain
The contents of .travis.yml is:
language: go
go:
- 1.12.x
script:
make
env:
- GO111MODULE=on GOPROXY=https://proxy.golang.org
The contents of my Makefile is:
# Go parameters
BINARY_FOLDER=./bin
GOCMD=go
GOBUILD=$(GOCMD) build
GOCLEAN=$(GOCMD) clean
GOTEST=$(GOCMD) test
GOGET=$(GOCMD) get
BINARY_NAME=captain
BINARY_UNIX=$(BINARY_NAME)_unix
all: test build
build:
$(GOBUILD) -o $(BINARY_FOLDER)/$(BINARY_NAME) ./cmd/...
test:
$(GOTEST) -v ./...
clean:
rm -rf $(BINARY_FOLDER)
run: all
$(BINARY_FOLDER)/$(BINARY_NAME)
# Cross compilation
build-linux:
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 $(GOBUILD) -o $(BINARY_UNIX) -v
docker-build:
docker run --rm -it -v "$(GOPATH)":/go -w /go/src/bitbucket.org/rsohlich/makepost golang:latest go build -o "$(BINARY_UNIX)" -v
When ever the travis build triggers it errors out saying:
go test -v ./...
go: finding github.com/gorilla/mux v1.7.3
go: finding github.com/lib/pq v1.2.0
go: finding github.com/google/uuid v1.1.1
go: finding github.com/DATA-DOG/go-sqlmock v1.3.3
go: downloading github.com/DATA-DOG/go-sqlmock v1.3.3
go: downloading github.com/lib/pq v1.2.0
go: extracting github.com/DATA-DOG/go-sqlmock v1.3.3
go: extracting github.com/lib/pq v1.2.0
# github.com/alwindoss/captain/cmd/captain
cmd/captain/main.go:4:2: undefined: Run
=== RUN TestCreateWorklistPositiveScenario
2019/08/10 14:56:19 Creating Worklist
2019/08/10 14:56:19 {"id": "ID", "name": "name"}
2019/08/10 14:56:19 Creating worklist in the RDBMS Store
2019/08/10 14:56:19 Last Inserted ID: 1
2019/08/10 14:56:19 ID = 1, affected = 1
--- PASS: TestCreateWorklistPositiveScenario (0.00s)
=== RUN TestCreateWorklistWhenBadRequestIsSent
2019/08/10 14:56:19 Creating Worklist
2019/08/10 14:56:19 This is a bad request
--- PASS: TestCreateWorklistWhenBadRequestIsSent (0.00s)
PASS
ok github.com/alwindoss/captain/internal/handler 0.005s
Makefile:15: recipe for target 'test' failed
make: *** [test] Error 2
In the job log I see that all my tests pass but the build does not go beyond this. The very same Makefile works without issues locally on my Mac.
I am not sure where the issue is. In the Makefile or in the way I have configured the Travis CI.
The interesting error message is:
cmd/captain/main.go:4:2: undefined: Run
So on line 4 of your main.go, you refer to an undefined symbol Run.