You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: alternately_print_test.go
    path of file: ./repos/Psyduck/go-concurrency/channel
    
    the code of the file until where you have to start completion: package channel

import (
	"fmt"
	"testing"
	"time"
)

// 有四个 goroutine，编号为 1、2、3、4。
// 每秒钟会有一个 goroutine 打印出它自己的编号，要求你编写一个程序，
// 让输出的编号总是按照 1、2、3、4、1、2、3、4、……的顺序打印出来。

func AlternatelyPrint() {
	ch1 := make(chan bool)
    
func AlternatelyPrint2() {
	ch := make(chan struct{})

	for i := 1; i < 5; i++ {
		go func(index int) {
			time.Sleep(time.Duration(index) * time.Millisecond)
			for {
				<-ch
				fmt.Printf("Goroutine %d \n", index)
				time.Sleep(time.Second)
				ch <- struct{}{}
			}
		}(i)
	}

	ch <- struct{}{}
	select {}
}