DEV Community

Cover image for Go'da main.go Programını Çalıştırmak
Tolga
Tolga

Posted on

Go'da main.go Programını Çalıştırmak

Go programını çalıştırmak için aşağıdaki adımları izleyin:

Ön Koşullar

Adım 1: Programınızın Bulunduğu Dizine Gitmek

Terminal veya komut istemcisini açın ve Go programınızın bulunduğu dizine gidin.

cd go/goinittestapi/application/cmd/server
Enter fullscreen mode Exit fullscreen mode

programınızın bilgisayarınızdaki konumuna göre değişiklik gösterir.

Adım 2: Programı Çalıştırmak

Programınızın bulunduğu dizinde, aşağıdaki go run komutunu kullanarak Go programınızı çalıştırın.

go run main.go
Enter fullscreen mode Exit fullscreen mode

Adım 3: Programı Derlemek ve Çalıştırılabilir Dosya Oluşturmak

Programınızı derleyerek bir çalıştırılabilir dosya oluşturmak için go build komutunu kullanın.

go build main.go
Enter fullscreen mode Exit fullscreen mode

Bu, main (Windows'ta main.exe) adında bir çalıştırılabilir dosya oluşturur. Daha sonra bu dosyayı doğrudan çalıştırabilirsiniz.

Linux veya macOS'te:

./main
Enter fullscreen mode Exit fullscreen mode

Qodo Takeover

Introducing Qodo Gen 1.0: Transform Your Workflow with Agentic AI

Rather than just generating snippets, our agents understand your entire project context, can make decisions, use tools, and carry out tasks autonomously.

Read full post

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay