Skip to content

Instantly share code, notes, and snippets.

View adopabianko's full-sized avatar
🎯
Focusing

Ado Pabianko adopabianko

🎯
Focusing
View GitHub Profile
@adopabianko
adopabianko / folder_structure.md
Created November 18, 2024 13:44 — forked from ayoubzulfiqar/folder_structure.md
The Folder Structure for Every Golang Project

Go - The Ultimate Folder Structure

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
FROM golang:1.23.0-bookworm AS build
ARG upx_version=4.2.4
RUN apt-get update && apt-get install -y --no-install-recommends xz-utils && \
curl -Ls https://github.com/upx/upx/releases/download/v${upx_version}/upx-${upx_version}-amd64_linux.tar.xz -o - | tar xvJf - -C /tmp && \
cp /tmp/upx-${upx_version}-amd64_linux/upx /usr/local/bin/ && \
chmod +x /usr/local/bin/upx && \
apt-get remove -y xz-utils && \
rm -rf /var/lib/apt/lists/*
{
"version": "0.2.0",
"configurations": [
{
"name": "Launch",
"type": "go",
"request": "launch",
"mode": "debug",
"remotePath": "",
"host": "127.0.0.1",
<?php
function sortMenu($data, $parent = 0, $space = '') {
if (isset($data[$parent])) {
$menu = '';
foreach($data[$parent] as $val) {
$newSpace = $space.'.';
$child = sortMenu($data, $val[0], $newSpace);
$menu .= $newSpace.' ';