Why do I need to log in to Github - go

Because xlsx tag v1.1.0 does not contain the latest features, I use the following command to update the xlsx package to master
# go get github.com/bingoohuang/xlsx#master
Username for 'https://github.com':
Why do I still need to login to download the github public code, this does not happen when I download packages from other go get
The strange thing is that I can execute it on windows, but the above login question occurs on centos7.
what caused this to happen? I really appreciate any help with this.

It looks like github.com/bingoohuang/xlsx#master depends on github.com/bingoohuang/go-yaml, which either does not exist or is private.
Because GitHub responds with a 404 error for private repositories, it is likely this missing repository is causing go get to issue a password prompt.
A go get for a library without missing dependencies (e.g., go get github.com/rs/zerolog#master) works without a problem.

Related

Gradle wrapper authenticated download credentials not being picked up from environment

Using gradle wrapper and specifying an internal repository URL to download the zip distribution - I followed the instructions from here: https://docs.gradle.org/5.2.1/userguide/gradle_wrapper.html#sec:authenticated_download
The https\://<username>:<password>#... in the distributionUrl works fine, but it's sub-optimal - we don't want credentials checked in source control. I tried:
systemProp.gradle.wrapperUser=<username>
systemProp.gradle.wrapperPassword=<password>
and confirmed that the properties are being set; however, they seem to be completely ignored. I keep getting a 401 unauthorized error when trying to access our internal repository. I tried all possibile combinations: systemProp.gradle.wrapperUser=username, gradle.wrapperUser=username and wrapperUser=username, nothing seems to work.
Any help is much appreciated.
Well, it turns out the issue was not with Gradle, but with IntelliJ, which seems to be overriding or completely ignoring the properties above. From a Unix shell script, everything works as advertised.

GOanda on github for Oanda API Rest in GoLang

When I try to install this package:
go get github.com/jasonnfls/goanda
I get this error:
/usr/local/go/bin/src/github.com/jasonnfls/goanda/trade.go:47: cannot use responseObj (type UpdateTradeResponse) as type OrderResponse in return argument
What would be the best way to resolve this?
Anyone have a good solution to this?
The bug in the package appears to be a copy/paste error. In the file trade.go, change the return value on line 20 from OrderResponse to UpdateTradeResponse, then run go install github.com/jasonnfls/goanda.
The file will be in your $GOPATH/src/github.com/jasonnfls/goanda
I submitted a pull request with the fix to the repo owner.
There's a bug in the package. It contains invalid code.
The solution would be to use an older version that isn't broken (if there is one), fix the bug, or get someone else (perhaps the author) to fix the bug.

How to solve Unexpected HTTP status code: 404(-1)

Although I set up my xcode swift file to create a repository when I click SourceControl -> Make a Working Copy I receive the error window "All projects are already under source control. Then when I to Window -> Welcome to Xcode -> "Check out an existing project" I get the error "Unexpected HTTP status code: 404(-1).
Does anyone have an idea on how to solve this please? Thank you
When you use Welcome to XCode > Check out an existing project you need to enter the github repository url as provided on the <> Code tab in github. It will look something like
https://github.com/username/MyRepository.git
In my case I got -401 with the following premises:
The URL was OK
The user credentials were OK
However, the user was not approved for downloading from that repository
Using the correct user solved the issue.
I got this issue when using xcode with bitbucket service.
Not entirely sure if I changed something or bitbucket changed something but I noticed that my domain in the URI for the remote had changed in bitbucket and xcode was no longer attempting to push to the correct path.
eg.
domain/repo.git
for some reason now was:
domaincom/repo.git
again, I do not remember changing anything but perhaps something changed in bitbucket to alter how the usernames are formed?
I think my team ( username ) was domain.com and they always worked with the first part up until the first . but perhaps changes have allowed for their service to remove all dots and use the full team name ( username )
I removed and re added the remote using the correct URI and it worked.
In my case, the issue was with my bitbucket plan which had exceeded the free plan tier and was restricted to read-only. Fixed my plan in bitbucket, and the issue was solved after a while.

Sonar rest API insufficient privileges

I can't access most of the Sonar API, for example
localhost:9000/api/tests/show?key=htmlparser:/src/test/java/HtmlParserTest.java
or see api/sources/scm. api/server/system and some other general stuff works but nothing where I actually see the code.
I always get a
{"errors":[{"msg":"Insufficient privileges"}]}
I set the project permissions to let anyone see source code & browse the porject, I tried it with Postman, a Java HttpRequest, the command line ...
curl -u admin:admin localhost:9000/api/tests/show?key=htmlparser:/src/test/java/HtmlParserTest.java
I checked with SonarQube 5.1 and 4.5.1. I've found a posts with the same issue but have yet to find a fix. Does anyone have a solution idea?
Thanks for your help
SOLUTION
It was a syntax error (even though the message said Insufficient privileges). The correct call would be:
localhost:9000/api/tests/show?key=htmlparser:htmlparser:src/test/java/HtmlParserTest.java
If you are not sure what goes before the "src/..." don't worry. You can get it by calling api/projects/index and looking at the attribute named "k".

Xcode setting up for git repository hung

I was trying to set up my Xcode 5 connecting to my github repository. The procedure stopped like this
It could never get through it. What else can I do to get it done? Thanks!
I ran into the same issue, and it turned out to be because I was using a lowercase username in the URL when my actual GitHub username is mixed-case (!). It seems that missing or invalid credentials sometimes simply cause it to hang on the "Verifying" step.
This is a long shot, but go to your GitHub profile and double-check the actual case of your username. Also try copying the clone URL from GitHub's web page for the repository, then adding the (username)# portion, to make sure there are no typos in your URL.

Resources