running gofmt on sources, and removing iconv LDFLAG on linux

This commit is contained in:
Donovan Jimenez 2013-06-27 16:56:58 -04:00
parent 76220410e9
commit c6169bab90
3 changed files with 11 additions and 12 deletions

View File

@ -3,7 +3,6 @@ package iconv
/*
#cgo darwin LDFLAGS: -liconv
#cgo freebsd LDFLAGS: -liconv
#cgo linux LDFLAGS: -liconv
#cgo windows LDFLAGS: -liconv
#include <stdlib.h>
#include <iconv.h>

View File

@ -2,9 +2,9 @@ package main
import (
"encoding/hex"
"io/ioutil"
"iconv"
"fmt"
"iconv"
"io/ioutil"
"os"
)
@ -12,7 +12,7 @@ func main() {
// read bytes from sample.utf8
utf8Bytes, err := ioutil.ReadFile("sample.utf8")
if (err != nil) {
if err != nil {
fmt.Println("Could not open 'sample.utf8': ", err)
}
@ -78,7 +78,7 @@ func main() {
}
// test iconv.Reader
utf8File,_ := os.Open("sample.utf8", os.O_RDONLY, 0)
utf8File, _ := os.Open("sample.utf8")
utf8Reader, _ := iconv.NewReader(utf8File, "utf-8", "ebcdic-us")
bytesRead, err = utf8Reader.Read(testBuffer)
@ -88,7 +88,7 @@ func main() {
fmt.Println("utf8 was property converted to ebcdic-us by iconv.Reader")
}
ebcdicFile,_ := os.Open("sample.ebcdic-us", os.O_RDONLY, 0)
ebcdicFile, _ := os.Open("sample.ebcdic-us")
ebcdicReader, _ := iconv.NewReader(ebcdicFile, "ebcdic-us", "utf-8")
bytesRead, err = ebcdicReader.Read(testBuffer)