RSS

Posts in 2021

  • Most votes on go questions 2

    May 01, 2021 in FAQ

    Most votes on go questions 2. #11 How to print struct variables in console? #12 What are the use(s) for tags in Go? #13 How to find the type of an object in Go? #14 Format a Go string without printing? #15 How to assign string to bytes array #16 When is the init() function run? #17 Reading a file line by line in Go #18 Pointers vs. values in parameters and return values #19 What is the idiomatic Go equivalent of C's ternary operator? #20 What should be the values of GOPATH and GOROOT?

    Read all the top votes questions and answers in a single page. #11: How to print struct variables in console? (Score: 473) Created: 2014-07-01 Last updated: 2019-12-06 Tags: struct, go How can I print (in the console) the Id, Title, Name, etc. of …

    Read more

  • Most votes on go questions 10

    May 01, 2021 in FAQ

    Most votes on go questions 10. #91 Parsing date string in Go #92 Does a break statement break from a switch/select? #93 How do you print in a Go test using the "testing" package? #94 What's the recommended way to connect to MySQL from Go? #95 Change values while iterating #96 Go install fails with error: no install location for directory xxx outside GOPATH #97 Access HTTP response as string in Go #98 How to get the number of characters in a string #99 Import cycle not allowed #100 Mock functions in Go

    Read all the top votes questions and answers in a single page. #91: Parsing date string in Go (Score: 166) Created: 2014-09-15 Last updated: 2019-04-11 Tags: date, go I tried parsing the date string "2014-09-12T11:45:26.371Z" in Go. Code …

    Read more

  • Most votes on go questions 1

    May 01, 2021 in FAQ

    Most votes on go questions 1. #1 How to check if a map contains a key in Go? #2 How to efficiently concatenate strings in go #3 How do you write multiline strings in Go? #4 Is there a foreach loop in Go? #5 What is an idiomatic way of representing enums in Go? #6 Concatenate two slices in Go #7 How to convert an int value to string in Go? #8 Optional Parameters in Go? #9 How can I convert a zero-terminated byte array to string? #10 How to check if a file exists in Go?

    Read all the top votes questions and answers in a single page. #1: How to check if a map contains a key in Go? (Score: 940) Created: 2010-01-12 Last updated: 2019-04-01 Tags: dictionary, go, go-map I know I can iterate over a map m by, for k, v := …

    Read more

  • Most votes on git questions 9

    May 01, 2021 in FAQ

    Most votes on git questions 9. #81 How can I see the changes in a Git commit? #82 How do you merge two Git repositories? #83 Do I commit the package-lock.json file created by npm 5? #84 How can I remove a commit on GitHub? #85 How to fetch all Git branches #86 Undo working copy modifications of one file in Git? #87 How does Git handle symbolic links? #88 How to compare files from two different branches? #89 How can I git stash a specific file? #90 Throw away local commits in Git

    Read all the top votes questions and answers in a single page. #81: How can I see the changes in a Git commit? (Score: 1786) Created: 2013-07-10 Last updated: 2021-04-11 Tags: git, version-control, diff, git-diff When I do git diff COMMIT I see the …

    Read more

  • Most votes on git questions 8

    May 01, 2021 in FAQ

    Most votes on git questions 8. #71 Make .gitignore ignore everything except a few files #72 How to recover a dropped stash in Git? #73 Is there a way to cache GitHub credentials for pushing commits? #74 Viewing unpushed Git commits #75 How to stop tracking and ignore changes to a file in Git? #76 How to replace master branch in Git, entirely, from another branch? #77 Detach (move) subdirectory into separate Git repository #78 Remove files from Git commit #79 Make the current Git branch a master branch #80 Could not open a connection to your authentication agent

    Read all the top votes questions and answers in a single page. #71: Make .gitignore ignore everything except a few files (Score: 1960) Created: 2009-06-12 Last updated: 2015-11-15 Tags: git, gitignore I understand that a .gitignore file cloaks …

    Read more

  • Most votes on git questions 7

    May 01, 2021 in FAQ

    Most votes on git questions 7. #61 How to list only the names of files that changed between two commits? #62 What are the differences between .gitignore and .gitkeep? #63 How can I delete a file from a Git repository? #64 How can I delete all Git branches which have been merged? #65 How to retrieve the hash for the current commit in Git? #66 How do I revert all local changes in Git managed project to previous state? #67 See what's in a stash without applying it #68 Easy way to pull latest of all git submodules #69 Branch from a previous commit using Git #70 Download a specific tag with Git

    Read all the top votes questions and answers in a single page. #61: How to list only the names of files that changed between two commits? (Score: 2189) Created: 2009-10-12 Last updated: 2021-03-11 Tags: git, git-diff, git-show I have a bunch of …

    Read more

  • Most votes on git questions 6

    May 01, 2021 in FAQ

    Most votes on git questions 6. #51 How do you push a tag to a remote repository using Git? #52 Comparing two branches in Git? #53 How do I make Git ignore file mode (chmod) changes? #54 Do a "git export" (like "svn export")? #55 How to change the commit author for one specific commit? #56 What is the best (and safest) way to merge a Git branch into master? #57 Git is not working after macOS Update (xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools) #58 How do I show the changes which have been staged? #59 How to "git clone" including submodules? #60 Showing which files have changed between two revisions

    Read all the top votes questions and answers in a single page. #51: How do you push a tag to a remote repository using Git? (Score: 2495) Created: 2011-03-04 Last updated: 2021-01-26 Tags: git, git-push, git-tag I have cloned a remote Git repository …

    Read more

  • Most votes on git questions 5

    May 01, 2021 in FAQ

    Most votes on git questions 5. #41 How to find and restore a deleted file in a Git repository #42 How do I make Git use the editor of my choice for commits? #43 I ran into a merge conflict. How can I abort the merge? #44 What does cherry-picking a commit with Git mean? #45 Git refusing to merge unrelated histories on rebase #46 Ignore files that have already been committed to a Git repository #47 How to change the author and committer name and e-mail of multiple commits in Git? #48 Git fetch remote branch #49 How to modify a specified commit? #50 How do you clone a Git repository into a specific folder?

    Read all the top votes questions and answers in a single page. #41: How to find and restore a deleted file in a Git repository (Score: 2964) Created: 2009-06-04 Last updated: 2020-10-21 Tags: git, file-io, git-checkout Say I’m in a Git …

    Read more

  • Most votes on git questions 4

    May 01, 2021 in FAQ

    Most votes on git questions 4. #31 Move existing, uncommitted work to a new branch in Git #32 How do you create a remote Git branch? #33 View the change history of a file using Git versioning #34 Stash only one file out of multiple files that have changed with Git? #35 Remove a file from a Git repository without deleting it from the local filesystem #36 Message 'src refspec master does not match any' when pushing commits in Git #37 Difference between "git add -A" and "git add ." #38 How to list all the files in a commit #39 How to get the current branch name in Git? #40 Commit only part of a file in Git

    Read all the top votes questions and answers in a single page. #31: Move existing, uncommitted work to a new branch in Git (Score: 3365) Created: 2009-09-08 Last updated: 2017-10-09 Tags: git, git-branch, git-stash, git-reset I started some work on a …

    Read more

  • Most votes on git questions 3

    May 01, 2021 in FAQ

    Most votes on git questions 3. #21 How to clone all remote branches in Git? #22 Undo a Git merge that hasn't been pushed yet #23 How do I update or sync a forked repository on GitHub? #24 Squash my last X commits together using Git #25 How to delete a remote tag? #26 How do I remove a submodule? #27 Make an existing Git branch track a remote branch? #28 Delete commits from a branch in Git #29 Undoing a git rebase #30 How do I clone a specific Git branch?

    Read all the top votes questions and answers in a single page. #21: How to clone all remote branches in Git? (Score: 4355) Created: 2008-09-15 Last updated: 2020-08-14 Tags: git, git-branch, git-clone, remote-branch I have a master and a development …

    Read more