mirror of
https://codeberg.org/pluja/kycnot.me
synced 2024-10-01 01:05:59 -04:00
🐛 fix(database.go): use strings.Join to concatenate attributes with a comma separator for better readability and maintainability in AddFakeData function
This commit is contained in:
parent
40a8331d40
commit
c35f8dc307
@ -3,6 +3,7 @@ package database
|
|||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"os"
|
"os"
|
||||||
|
"strings"
|
||||||
|
|
||||||
_ "github.com/mattn/go-sqlite3"
|
_ "github.com/mattn/go-sqlite3"
|
||||||
"github.com/rs/zerolog/log"
|
"github.com/rs/zerolog/log"
|
||||||
@ -39,7 +40,7 @@ func AddFakeData() {
|
|||||||
SetFiat(true).
|
SetFiat(true).
|
||||||
SetCash(true).
|
SetCash(true).
|
||||||
SetType(service.TypeExchange).
|
SetType(service.TypeExchange).
|
||||||
SetAttributes([]string{AttributeNonCustodialWallet, AttributeOpenSource, AttributeNoPersonalInfoNeeded, AttributeP2P}).
|
SetAttributes(strings.Join([]string{AttributeNonCustodialWallet, AttributeOpenSource, AttributeNoPersonalInfoNeeded, AttributeP2P, AttributeAPIAvailable, AttributePartnersMayEnforceKYC, AttributeBlockFundsIfFlagged, AttributeKYCForSomeFeatures}, ",")).
|
||||||
SetTosHighlights(&[]schema.TosHighlight{sampleTosHighlight}).
|
SetTosHighlights(&[]schema.TosHighlight{sampleTosHighlight}).
|
||||||
Save(context.Background())
|
Save(context.Background())
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -64,7 +65,7 @@ func AddFakeData() {
|
|||||||
SetFiat(true).
|
SetFiat(true).
|
||||||
SetCash(true).
|
SetCash(true).
|
||||||
SetType(service.TypeExchange).
|
SetType(service.TypeExchange).
|
||||||
SetAttributes([]string{AttributeNonCustodialWallet, AttributeOpenSource, AttributeNoPersonalInfoNeeded, AttributeP2P}).
|
SetAttributes(strings.Join([]string{AttributeNonCustodialWallet, AttributeOpenSource, AttributeNoPersonalInfoNeeded, AttributeP2P}, ",")).
|
||||||
SetTosHighlights(&[]schema.TosHighlight{sampleTosHighlight}).
|
SetTosHighlights(&[]schema.TosHighlight{sampleTosHighlight}).
|
||||||
Save(context.Background())
|
Save(context.Background())
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
Loading…
Reference in New Issue
Block a user