review3 renames
This commit is contained in:
@ -20,14 +20,14 @@ func ServerFromUrl(url string) *Server {
|
||||
return &s
|
||||
}
|
||||
|
||||
func (contact *ContactCard) AddUrls(urls []string) {
|
||||
func (Contact *ContactCard) AddUrls(urls []string) {
|
||||
for _, url := range urls {
|
||||
contact.PullServers = append(contact.PullServers, ServerFromUrl(url))
|
||||
Contact.PullServers = append(Contact.PullServers, ServerFromUrl(url))
|
||||
}
|
||||
}
|
||||
|
||||
func (contact *ContactCard) WritePng(filename string) {
|
||||
jsonContact, _ := json.Marshal(contact)
|
||||
func (Contact *ContactCard) WritePng(filename string) {
|
||||
jsonContact, _ := json.Marshal(Contact)
|
||||
//imgdata := base64.StdEncoding.EncodeToString(jsonContact)
|
||||
size := int(math.Sqrt(float64(len(jsonContact))/3)) + 1
|
||||
println(size)
|
||||
@ -65,8 +65,8 @@ func (contact *ContactCard) WritePng(filename string) {
|
||||
|
||||
}
|
||||
|
||||
func (contact *ContactCard) WriteQr(filename string) {
|
||||
jsonContact, _ := json.Marshal(contact)
|
||||
func (Contact *ContactCard) WriteQr(FileName string) {
|
||||
jsonContact, _ := json.Marshal(Contact)
|
||||
qwriter := qrcode.NewQRCodeWriter()
|
||||
code, err := qwriter.Encode(string(jsonContact), gozxing.BarcodeFormat_QR_CODE, 512, 512, nil)
|
||||
if err != nil {
|
||||
@ -81,8 +81,8 @@ func (contact *ContactCard) WriteQr(filename string) {
|
||||
|
||||
}
|
||||
|
||||
func ReadQr(fielname string) ContactCard {
|
||||
var contact ContactCard
|
||||
func ReadQr(FileName string) ContactCard {
|
||||
var Contact ContactCard
|
||||
// open and decode image file
|
||||
file, _ := os.Open("qrcode.jpg")
|
||||
img, _, _ := image.Decode(file)
|
||||
@ -95,5 +95,5 @@ func ReadQr(fielname string) ContactCard {
|
||||
result, _ := qrReader.Decode(bmp, nil)
|
||||
|
||||
fmt.Println(result)
|
||||
return contact
|
||||
return Contact
|
||||
}
|
||||
|
Reference in New Issue
Block a user