System: Debian/Ubuntu/Fedora. Might work for others as well.
As mentioned here, to update a go version you will first need to uninstall the original version.
To uninstall, delete the /usr/local/go
directory by:
System: Debian/Ubuntu/Fedora. Might work for others as well.
As mentioned here, to update a go version you will first need to uninstall the original version.
To uninstall, delete the /usr/local/go
directory by:
Organizing your Go (Golang) project's folder structure can help improve code readability, maintainability, and scalability. While there is no one-size-fits-all structure, here's a common folder structure for a Go project:
project-root/
├── cmd/
│ ├── your-app-name/
│ │ ├── main.go # Application entry point
│ │ └── ... # Other application-specific files
logger := slog.New(slog.NewJSONHandler(os.Stdout, &slog.HandlerOptions{ | |
AddSource: false, | |
Level: slog.LevelDebug, | |
})) | |
slog.SetDefault(logger) | |
watcher, err := watcher.New(logger) | |
defer watcher.Shutdown() | |
err = watcher.Watch("/home/user", func(e watcher.Event) error { |
package main | |
import "testing" | |
func BenchmarkConcMap100(b *testing.B) { | |
b.StopTimer() | |
input := createRange(100) | |
output := make([]int, 0, len(input)) | |
b.StartTimer() |
package main | |
import ( | |
"fmt" | |
"net/http" | |
) | |
type CustomResponseWriter struct { | |
body []byte | |
statusCode int |
// gin will throw following for the first time due to secure initiate a http.Redirect but gin is unaware of it | |
// [GIN-debug] [WARNING] Headers were already written. Wanted to override status code 301 with 200 | |
package main | |
import ( | |
"github.com/gin-gonic/gin" | |
"github.com/unrolled/secure" | |
) |
Source link: https://stackoverflow.com/questions/31374085/installing-adb-on-macos | |
# Option 1 - Using Homebrew | |
This is the easiest way and will provide automatic updates. | |
1. Install [homebrew](http://brew.sh/) | |
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" | |
2. Install adb |
# pull/update multi git repos, | |
multipull0='ls | xargs -I{} git -C {} pull --ff' | |
# for laravel | |
pa='php artisan serv' | |
pad='php artisan dump-autoload' | |
# i use high sierra and macport cuz brew dosnt always work on high sierra | |
sqla='sudo port unload mysql8-server' | |
sqlu='sudo port load mysql8-server' |
#!/bin/bash | |
########### | |
# ./convert_repo.sh | |
# Author: Igor Serko <[email protected]> | |
# Description: Allows the user to join multiple git repositories under one single repository | |
# Procedure: Using git filter-branch we rewrite the history of every repo | |
# example of current tree | |
# -- REPOONE | |
# |-- repoone files | |
# -- REPOTWO |
[dev] | |
url = "http://dev.example.com" | |
username = "dev.account" | |
password = "devdev" | |
[test] | |
url = "http://test.example.com" | |
username = "test.account" | |
password = "testtest" |