Skip to content

Instantly share code, notes, and snippets.

View sakishen's full-sized avatar
🎯
Focusing

saki.shen-vrviu sakishen

🎯
Focusing
View GitHub Profile
@r0l1
r0l1 / copy.go
Last active March 24, 2025 21:38
Copy a directory tree (preserving permissions) in Go.
/* MIT License
*
* Copyright (c) 2017 Roland Singer [[email protected]]
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
@mattes
mattes / check.go
Last active February 19, 2025 20:32
Check if file or directory exists in Golang
if _, err := os.Stat("/path/to/whatever"); os.IsNotExist(err) {
// path/to/whatever does not exist
}
if _, err := os.Stat("/path/to/whatever"); !os.IsNotExist(err) {
// path/to/whatever exists
}
@denji
denji / http-benchmark.md
Last active March 27, 2025 19:46
HTTP(S) Benchmark Tools / Toolkit for testing/debugging HTTP(S) and restAPI (RESTful)