To create a JWT token in Go, you can use the jwt-go library. First, you need to install the library using the following command:

go get github.com/dgrijalva/jwt-go

Then, you can use the following code snippet to create a JWT token:

package main

import (
    "fmt"
    "time"

    "github.com/dgrijalva/jwt-go"
)

func main() {
    // Define the payload
    claims := jwt.MapClaims{
        "sub": "1234567890",
        "name": "John Doe",
        "iat": time.Now().Unix(),
        "exp": time.Now().Add(time.Hour * 24).Unix(), // Token expires in 24 hours
    }

    // Create the token
    token := jwt.NewWithClaims(jwt.SigningMethodHS256, claims)

    // Sign the token with a secret key
    secret := "my-secret-key"
    tokenString, err := token.SignedString([]byte(secret))
    if err != nil {
        fmt.Println("Error creating token:", err)
        return
    }

    fmt.Println(tokenString)
}
In this example, we define the payload as a map of claims, including the subject (sub), name (name), issue time (iat), and expiration time (exp). We then create a new token using the jwt.NewWithClaims function and sign it with the HMAC-SHA256 algorithm using a secret key. Finally, we print out the token string.

Note that you should use a secure secret key and store it securely, as anyone with access to the key can create or decode JWT tokens.