zeekayandHanzo Dev fd41b9f0e7 go.mod: raise go directive 1.13 -> 1.26.5
1 module(s) in this repo declared go < 1.22. Go 1.22 changed for-loop
variable scoping to per-iteration, so raising the directive past 1.22 can
change runtime behaviour. Each module here was scanned for loops whose
loop variable is captured by a func literal / goroutine / defer, or has its
address taken: zero such sites were found, so the bump is behaviour-preserving.

Also fix 2 non-constant format strings (fmt.Fprintf(w, string(data)) -> w.Write(data)),
which Go's printf vet check flags from language version 1.24 on.
Verified per module with go build, go vet and go test (-mod=readonly).

Co-authored-by: Hanzo Dev <[email protected]>
2026-07-27 15:47:16 -07:00
2021-02-17 22:35:53 +02:00
2016-08-31 20:30:38 -05:00
2016-08-31 16:29:33 -05:00
2021-03-03 14:29:22 +00:00
2016-08-31 16:30:29 -05:00
2021-02-17 22:35:53 +02:00
2016-08-31 16:29:33 -05:00
2020-07-12 15:48:58 +09:00

gochimp3

GoDoc Build Status Gitter chat

Introduction

Golang client for MailChimp API 3.0.

Install

Install with go get:

$ go get github.com/hanzoai/gochimp3

Usage

package main

import (
	"fmt"
	"os"

	"github.com/hanzoai/gochimp3"
)

const (
	apiKey = "YOUR_API_KEY_HERE"
)

func main() {
	client := gochimp3.New(apiKey)

	// Audience ID
	// https://mailchimp.com/help/find-audience-id/
	listID := "7f12f9b3fz"

	// Fetch list
	list, err := client.GetList(listID, nil)
	if err != nil {
		fmt.Printf("Failed to get list %s", listID)
		os.Exit(1)
	}

	// Add subscriber
	req := &gochimp3.MemberRequest{
		EmailAddress: "[email protected]",
		Status:       "subscribed",
	}

	if _, err := list.CreateMember(req); err != nil {
		fmt.Printf("Failed to subscribe %s", req.EmailAddress)
		os.Exit(1)
	}
}

Set Timeout

client := gochimp3.New(apiKey)
client.Timeout = (5 * time.Second)
S
Description
πŸ’ Golang client for MailChimp API 3.0.
Readme MIT
222 KiB
Languages
Go 100%