 
  
   
  
   
  
  if i % 2000 == 0 {....}       
  
  pwsh = "pwsh"
command = []string{"-Command", "Send-MailMessage -SMTPServer localhost -Port 25 -To " + recipient + " -From " + user.Email + ` -Subject "` + subject + `" -Body "` + message + `"`
output, err := exec.Command(pwsh, command...).Output() 
  
   
  
   
  
   
  
   
  
  // Вводим интерфейс с методом Close
// Можем даже использовать готовый io.Closer
type Closer interface {
    Close()
}
// Проверяем, удовлетворяет ли Handler интерфейсу
if casted,ok := m.Handler.(Closer); ok {
    // Если удовлетворяет, вызываем метод
    casted.Close()
} 
  
  type T struct {
  Count int
}
func (t *T) Func(s string) error {
    t.Count // <- получение доступа к полю структуры
} 
  
  s1 := s1{
		{
			{}, {
				{}, {}, {}, {}, {},
			}, {},
		},
	}type s1 struct {
	Value    int // тут любой тип можно, в принципе, лучше указателем
	Children []s1
}
func main() {
	s1 := s1{
		Children: []s1{
			{Children: []s1{
				{Value: 1}, {Value: 2}, {Value: 3},
			}},
			{Children: []s1{
				{Value: 4}, {Value: 5},
			}},
		},
	}
	fmt.Println(s1)
} 
  
   
  
   
  
  package main
import (
	"fmt"
	"regexp"
)
func main() {
	text := "`От:` <@317989885321674753>\n`На:` <@163995016027439106>\n`Причина:` <@!163995016027439106>"
	re := regexp.MustCompile(`\<\@\!?(\d{18})\>`)
	matches := re.FindAllStringSubmatch(text, -1)
	for _, match := range matches {
		if len(match) > 1 {
			fmt.Println(match[1])
		}
	}
} 
  
  func interToInt64(inp interface{}) (int64, error) {
	switch v := inp.(type) {
	case int:
		return int64(v), nil
	case int8:
		return int64(v), nil
	case int16:
		return int64(v), nil
	case int32:
		return int64(v), nil
	case int64:
		return v, nil
	case uint:
		return int64(v), nil
	case uint8:
		return int64(v), nil
	case uint16:
		return int64(v), nil
	case uint32:
		return int64(v), nil
	case uint64:
		return int64(v), nil
	case string:
		return strconv.ParseInt(v, 10, 64)
	default:
		return 0, fmt.Errorf("unsupported type %T", inp)
	}
}