package main import ( "context" // "fmt" // "regexp" // "strings" // "t0xa/pdf_to_txt/internal/parser" "github.com/jackc/pgx/v5" ) type CheckEntry struct { Product string Price string } func main() { // TODO: Redo format of file passing to function // text := parser.ParseX5Check("./internal/parser/testfiles/test3.pdf") // // split := strings.Split(text, "\n") // stringsToFilter := "https://mail|Gmail - Электронный чек|Сумма|НДС" // re := regexp.MustCompile(stringsToFilter) // filtered := []string{} // for _, element := range split { // if re.MatchString(element) { // continue // } // if len(element) < 1 { // continue // } // filtered = append(filtered, element) // // } // for index, element := range filtered { // if element == "Цена*Кол" { // fmt.Println("Товар: ", filtered[index-1]) // fmt.Println("Цена: ", filtered[index+1]) // fmt.Println("------") // } // } ctx := context.Background() conn, err := pgx.Connect(ctx, "postgres://ruprod_user:ruprod_password@localhost:5433") if err != nil { panic(err) } defer conn.Close(ctx) }