Tag Archives: Go

go :Multiple-value strconv.Atoi() (int, error) in single-value context


devicePositionType := strconv.Atoi(info[0]["device_position_type"].(string))

report errors

Multiple-value strconv.Atoi() (int, error) in single-value context

This is because the returned data has two parameters, and only one is defined in the code, so the code needs to add another parameter, which is generally defined as err

devicePositionType,err := strconv.Atoi(info[0]["device_position_type"].(string))

But I can’t use err. If I don’t use err, go will still report an error

Unused variable 'err'

So it needs to be written like this

devicePositionType,_ := strconv.Atoi(info[0]["device_position_type"].(string))

It means that I will not call it later, and I have defined two parameters and will not report an error

Error in pushing git code to gitee by vscode:! [remote rejected] Master – > Master (pre receive hook declined)

Error reporting environment: vscode + git 2.28.0. Windows. 1 + gitee code management

Error content:

When using vscode to push code to gitee, use git push origin develop:develop After , the following error occurred.

// An highlighted block
remote: This repository(including wiki) size 1418.54 MB, exceeds 1024.00 MB.
remote: Push rejected for repository size exceeds limit.
remote: HelpLink:           https://gitee.com/help/······
remote: Repository GC:      https://gitee.com/······
remote: Enterprise Edition: https://gitee.com/······
To gitee.com:filename.git
 ! [remote rejected] develop -> develop (pre-receive hook declined)
error: failed to push some refs to 'gitee.com:filename.git'


The total number of warehouse files in gitee is too large, which exceeds the upper limit of gitee storage. After streamlining the warehouse files, successfully push .

Git prompts another git process sees to be running in this repository, e.g. an editor opened by

Another git process seems to be running in this repository, e.g. An editor is opened by ‘git commit’. Please make sure all processes are terminated then try again. a git process may have crashed in this repository earlier: remove the file manually to continue.

Another Git process appears to be running in this repository, such as the editor opened by ‘git commit’. Make sure all processes are terminated and try again. If it still fails, then a Git process may have crashed earlier in the repository: manually delete the file to continue.
If you have an editor with the “git commit” command on, close all git related processes and try again. If not, delete the file manually.
Windows for the process of synchronous mutually exclusive management, there is a resource lock mechanism. There must be a process to lock a resource, but because the process suddenly crashed, not in time to unlock, resulting in other processes can not access
We delete a mutex file on the line, into the workspace directory under the hidden file. Git, where the index.lock file deleted, the problem solved.

Fatal: reusing to merge unrelated histories

Git: fatal: refusing to merge unrelated nothing is solved
Today to create a local warehouse (README), the local warehouse and making the association, found that the git pull, git feach remind fatal: refusing to merge unrelated nothing

access to the Internet to check the reason was that the two branches are two different versions, and have different submission history


$git pull origin master --allow-unrelated-histories

Can allow irrelevant history to mention, forced merger, really solved this problem, thank you

Resolving fatal: reusing to merge unrelated histories in Git

An error of Git
Sometimes there are some problems in the process of using Git, so when you solve each problem, you need to summarize and record it, so that you won’t do it again.
A, fatal: refusing to merge unrelated nothing
Today, while creating a project with Git, the following error occurred when two branches were merged.

~/SpringSpace/newframe on  master ⌚ 11:35:56
$ git merge origin/druid
fatal: refusing to merge unrelated histories

The key to the problem here is: fatal: refusing to merge unrelated nothing
you might be in the git pull or git push are likely to encounter, this is because the two branches without relationship. So what's the solution?
Second, solutions
Behind the commands you add - allow - unrelated - nothing
for example:
git merge master - allow - unrelated - nothing

~/SpringSpace/newframe on  druid ⌚ 11:36:49
$ git merge master --allow-unrelated-histories
Auto-merging .gitignore
CONFLICT (add/add): Merge conflict in .gitignore
Automatic merge failed; fix conflicts and then commit the result.

If you are a git pull or git push to fatal: refusing to merge unrelated nothing
in the same way:
git pull origin master - allow - unrelated - nothing
and so on, this is the perfect solution to cough up!

Git centenary export package file command

Git exports a commit record:
git diff-tree -r –no-commit-id –name-only –diff-filter=ACMRT 630367c03957082cae20aa72411307f4370a96b2 | xargs tar -rf www.zip
Git lists the difference files:
git diff 39147a10305f452bb286c97ac24a1aae90ecfc3e 72800ec95fdab3e4243d6a4d2db91739e487955b –name-only
Git exports the difference between two commitid packages:
git diff 39147a10305f452bb286c97ac24a1aae90ecfc3e 72800ec95fdab3e4243d6a4d2db91739e487955b –name-only | xargs tar -rf update.zip

Git authentication failure solution, due to the problem of password modification

fatal: Authentication failed for ‘http:xxxxxxxxxx.git/’

The solution

1. git config –global user.name “username”

Git config –global user.email “email” git config –global user.email


2. Git config –system –unset credential


3. Control Panel – User Account – Voucher Manager – Ordinary Voucher, modify and delete the git password in it

Reproduced in: https://www.cnblogs.com/ChineseLiao/p/9400191.html

Git failed to authenticate

Git config –system –unset credential
Git config –global credential. Helper store
Git Config Credential. Helper Store (preferably this)
3, git pull pull code, will prompt for user name and password

Git clear saved accounts

Git will automatically save the user name and password you have entered.
Git’s configuration file is ~ /.gitconfig. GitConfig can be opened with Vim ~/. GitConfig from the command line of Git Bash and Mac under Windows.


git config --system --unset credential.helper


sudo git config --system --unset credential.helper


Reproduced in: https://www.cnblogs.com/sea-breeze/p/9174557.html