Welcome to the GoFrame Quick Start Guide! GoFrame is a modern Go framework designed with modularity and loose coupling in mind. You can use it either as a full-featured application framework or cherry-pick individual components for your specific needs.

This guide will walk you through installing and setting up GoFrame, culminating in building your first web service.

Installation - 图1info

New to Go? We recommend checking out our Environment Setup Guide first to get your development environment ready.

Stuck or have questions? Feel free to leave a comment 💬. Our community is here to help, and we’ll get back to you as quickly as possible 🌟🌟.

Go Version Requirements

To ensure stability and security, GoFrame maintains compatibility with recent Go versions. We typically support the latest release and three previous versions.

Minimum requirement:

  1. golang version >= 1.20

Getting Started

Install the latest version:

  1. go get -u -v github.com/gogf/gf/v2

Or add this to your go.mod:

  1. require github.com/gogf/gf/v2 latest

Quick Test

Let’s verify your installation with a simple program:

main.go

  1. package main
  2. import (
  3. "fmt"
  4. "github.com/gogf/gf/v2"
  5. )
  6. func main() {
  7. fmt.Println("Hello GF:", gf.VERSION)
  8. }

Run it:

  1. go run main.go

You should see something like:

  1. Hello GF: v2.7.4

Perfect! Now that GoFrame is set up, let’s build your first HTTP server.