This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # Delete all directories that are called 'build' in the directory from where this script | |
| # is invoked. | |
| echo -e "Removing all 'build' subdirectories..." | |
| # According to https://github.com/koalaman/shellcheck/wiki/SC2038 whitespaces are interpreted | |
| # by xargs in an unsafe way, therefore -print0 was added to `find` and -0 to `xargs`. | |
| #find . -name "build" -type d | xargs -t -I {} rm -rf {} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //Tested with Go 1.19 | |
| func RemoveElementFromSliceAtIndex[type_param any](s []type_param, index int) []type_param { | |
| return append (s[:index], s[index+1:]...) | |
| } | |
| //Calling the function | |
| RemoveElementFromSliceAtIndex[Your_Type](slice, index_of_item_to_remove) | |
| //This function cannot be called while looping as the item at index_of_item_to_remove+1 will reside at index_of_item_to_remove after calling this function! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package logging | |
| import ( | |
| "fmt" | |
| "os" | |
| "time" | |
| ) | |
| var enable_logging bool = true |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package caching | |
| type pagedMapCacheKey struct { | |
| key int | |
| page_number int | |
| page_size int | |
| } | |
| const enable_caching bool = false |