package internal

import (
	"fmt"
	"sync"
	"time"
)

type Singleton struct {
	name string
}

var instance *Singleton
var once sync.Once

func GetInstance() *Singleton {
	once.Do(func() {
		instance = &Singleton{name: fmt.Sprintf("Golang Singleton %v", time.Now().UnixNano())}
	})
	return instance
}

func (s *Singleton) GetName() string {
	return s.name
}
