Okay, so I was just tryna figure out how big this HUGE repo I'm working on actually is.
Turns out, finding that info was a pain. So, I decided to build something to make my life easier when dealing with massive codebases.
Introducing Git-Bit, a lil' website that gives you insights on a GitHub repo including its size.
[Website link] [GitHub repo]
#MyProjects #GitBit #github
Turns out, finding that info was a pain. So, I decided to build something to make my life easier when dealing with massive codebases.
Introducing Git-Bit, a lil' website that gives you insights on a GitHub repo including its size.
[Website link] [GitHub repo]
#MyProjects #GitBit #github
β€8π₯2
throwback to the first design i made. the G @DoughNutDrops looked at it and gave me positive feedback back then. never touched designing afterwards tho π
#throwback
#throwback
π₯5
Makefiles in Go: Streamline Your Build Process
Makefiles help in compilation, testing, and deployment of your code. While they might seem intimidating at first, they offer a powerful way to automate your workflow and make your life as a Go developer much easier.
What is a Makefile?
Imagine you have a complex Go project with multiple files and dependencies. Manually compiling everything each time you make a change would be a nightmare, right? That's where Makefiles come in. They are simple text files that contain instructions for building your Go project. Think of them as a set of recipes that tell your computer how to compile, test, and package your code.
Why Use Makefiles in Go?
Automation: Makefiles automate repetitive tasks, like compiling your code, running tests, and generating documentation.
Efficiency: They only recompile the necessary files, saving you time and resources.
Organization: They provide a clear structure for your build process, making it easier to understand and maintain.
Consistency: Ensure that your build process is always consistent, regardless of the environment or developer.
Makefiles in action
Let's break down the essential components of a Makefile:
1. Targets: These are the tasks you want to perform, like "build," "test," or "clean."
2. Dependencies: These specify the files or other targets that a target depends on. For instance, the "build" target might depend on the "test" target.
3. Commands: These are the actual instructions to be executed. They are written after the target and dependencies.
A Simple Makefile Example:
Code Break Down:
We have three targets: "build," "test," and "clean."
The "build" target depends on nothing and executes the
The "test" target also depends on nothing and executes the
The "clean" target removes the
Go-Specific Makefile Enhancements:
Go Modules: Makefiles work seamlessly with Go modules. You can use variables to specify your module path and other settings.
Package Management: Makefiles can be used to manage dependencies, downloading and installing them automatically.
Cross-Compilation: Easily compile your Go code for different operating systems and architectures.
Beyond the Basics:
Makefiles are incredibly versatile. You can define custom targets for tasks like:
Documentation generation: Use tools like godoc to create API documentation.
Code formatting: Automatically format your code using tools like gofmt.
Deployment: Automate the deployment of your application to cloud platforms.
Concluding thoughts
Makefiles are powerful tools that can significantly improve your Go development experience by automating tasks, managing dependencies, and streamlining your workflow.
#TakeAByte #Makefile #golang #DevTools
@Mi_Ra_Ch
Makefiles help in compilation, testing, and deployment of your code. While they might seem intimidating at first, they offer a powerful way to automate your workflow and make your life as a Go developer much easier.
What is a Makefile?
Imagine you have a complex Go project with multiple files and dependencies. Manually compiling everything each time you make a change would be a nightmare, right? That's where Makefiles come in. They are simple text files that contain instructions for building your Go project. Think of them as a set of recipes that tell your computer how to compile, test, and package your code.
Why Use Makefiles in Go?
Automation: Makefiles automate repetitive tasks, like compiling your code, running tests, and generating documentation.
Efficiency: They only recompile the necessary files, saving you time and resources.
Organization: They provide a clear structure for your build process, making it easier to understand and maintain.
Consistency: Ensure that your build process is always consistent, regardless of the environment or developer.
Makefiles in action
Let's break down the essential components of a Makefile:
1. Targets: These are the tasks you want to perform, like "build," "test," or "clean."
2. Dependencies: These specify the files or other targets that a target depends on. For instance, the "build" target might depend on the "test" target.
3. Commands: These are the actual instructions to be executed. They are written after the target and dependencies.
A Simple Makefile Example:
# Build the application
build:
go build -o main main.go
# Run the tests
test:
go test -v ./...
# Clean up built files
clean:
rm -f main
Code Break Down:
We have three targets: "build," "test," and "clean."
The "build" target depends on nothing and executes the
go build command to compile the main.go file into an executable named main.The "test" target also depends on nothing and executes the
go test command to run all tests within the project.The "clean" target removes the
main executable.Go-Specific Makefile Enhancements:
Go Modules: Makefiles work seamlessly with Go modules. You can use variables to specify your module path and other settings.
Package Management: Makefiles can be used to manage dependencies, downloading and installing them automatically.
Cross-Compilation: Easily compile your Go code for different operating systems and architectures.
Beyond the Basics:
Makefiles are incredibly versatile. You can define custom targets for tasks like:
Documentation generation: Use tools like godoc to create API documentation.
Code formatting: Automatically format your code using tools like gofmt.
Deployment: Automate the deployment of your application to cloud platforms.
Concluding thoughts
Makefiles are powerful tools that can significantly improve your Go development experience by automating tasks, managing dependencies, and streamlining your workflow.
#TakeAByte #Makefile #golang #DevTools
@Mi_Ra_Ch
it's quite likely that the installation of new Go version fails especially if you're on linux. so instead of directly deleting the existing Go setup, move it to old directory and install the new one.
if something goes wrong while installing the new version, itβs good to have the previous one around.
#tips #golang #linux
@Mi_Ra_Ch
mv /usr/local/go /usr/local/old-go
tar -C /usr/local -xzf go1.22.6.linux-amd64.tar.gz
rm -rf /usr/local/old-go
if something goes wrong while installing the new version, itβs good to have the previous one around.
#tips #golang #linux
@Mi_Ra_Ch