You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by ma...@apache.org on 2016/02/12 22:42:07 UTC
[2/2] incubator-mynewt-newt git commit: Go formatting.
Go formatting.
Project: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/commit/ba86d5cd
Tree: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/tree/ba86d5cd
Diff: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/diff/ba86d5cd
Branch: refs/heads/master
Commit: ba86d5cdf25353e464c9c26493b3fb67f859fd73
Parents: 955bb39
Author: Marko Kiiskila <ma...@runtime.io>
Authored: Fri Feb 12 13:41:32 2016 -0800
Committer: Marko Kiiskila <ma...@runtime.io>
Committed: Fri Feb 12 13:41:32 2016 -0800
----------------------------------------------------------------------
newt/cli/builtpkg.go | 6 +++---
newt/cli/image.go | 42 +++++++++++++++++++++---------------------
newt/cli/project.go | 2 +-
3 files changed, 25 insertions(+), 25 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/ba86d5cd/newt/cli/builtpkg.go
----------------------------------------------------------------------
diff --git a/newt/cli/builtpkg.go b/newt/cli/builtpkg.go
index 28f1bd0..48f8df2 100644
--- a/newt/cli/builtpkg.go
+++ b/newt/cli/builtpkg.go
@@ -24,8 +24,8 @@ import (
)
type BuiltPkg struct {
- Name string
- Hash string
+ Name string
+ Hash string
Version string
}
@@ -43,7 +43,7 @@ func NewBuiltPkg(pkg *Pkg) (*BuiltPkg, error) {
} else {
verStr = ""
}
-
+
builtpkg := &BuiltPkg{
Name: pkg.FullName,
Hash: hash,
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/ba86d5cd/newt/cli/image.go
----------------------------------------------------------------------
diff --git a/newt/cli/image.go b/newt/cli/image.go
index 69da2d3..aee89fc 100644
--- a/newt/cli/image.go
+++ b/newt/cli/image.go
@@ -25,8 +25,8 @@ import (
"encoding/binary"
"encoding/json"
"fmt"
- "log"
"io"
+ "log"
"os"
"path/filepath"
"sort"
@@ -54,13 +54,13 @@ type Image struct {
}
type ImageHdr struct {
- Magic uint32
- Pad1 uint32
- HdrSz uint32
- ImgSz uint32
- Flags uint32
- Vers ImageVersion
- Pad2 uint32
+ Magic uint32
+ Pad1 uint32
+ HdrSz uint32
+ ImgSz uint32
+ Flags uint32
+ Vers ImageVersion
+ Pad2 uint32
}
type ImageTrailerTlv struct {
@@ -70,7 +70,7 @@ type ImageTrailerTlv struct {
}
const (
- IMAGE_MAGIC = 0x96f3b83c /* Image header magic */
+ IMAGE_MAGIC = 0x96f3b83c /* Image header magic */
)
const (
@@ -81,27 +81,27 @@ const (
* Image header flags.
*/
const (
- IMAGE_F_PIC = 0x00000001
- IMAGE_F_HAS_SHA256 = 0x00000002 /* Image contains hash TLV */
+ IMAGE_F_PIC = 0x00000001
+ IMAGE_F_HAS_SHA256 = 0x00000002 /* Image contains hash TLV */
)
/*
* Image trailer TLV types.
*/
const (
- IMAGE_TLV_SHA256 = 1
+ IMAGE_TLV_SHA256 = 1
)
/*
* Data that's going to go to build manifest file
*/
type ImageManifest struct {
- Date string `json:"build_time"`
- Version string `json:"build_version"`
- Hash string `json:"id"`
- Image string `json:"image"`
- Pkgs []*ImageManifestPkg `json:"pkgs"`
- TgtVars []string `json:"target"`
+ Date string `json:"build_time"`
+ Version string `json:"build_version"`
+ Hash string `json:"id"`
+ Image string `json:"image"`
+ Pkgs []*ImageManifestPkg `json:"pkgs"`
+ TgtVars []string `json:"target"`
}
type ImageManifestPkg struct {
@@ -183,7 +183,7 @@ func (image *Image) Generate() error {
}
imgFile, err := os.OpenFile(image.TargetImg,
- os.O_CREATE | os.O_TRUNC | os.O_WRONLY, 0777)
+ os.O_CREATE|os.O_TRUNC|os.O_WRONLY, 0777)
if err != nil {
return NewNewtError(fmt.Sprintf("Can't open target image: %s",
err.Error()))
@@ -198,7 +198,7 @@ func (image *Image) Generate() error {
/*
* First the header
*/
- hdr := &ImageHdr {
+ hdr := &ImageHdr{
Magic: IMAGE_MAGIC,
Pad1: 0,
HdrSz: IMAGE_HEADER_SIZE,
@@ -300,7 +300,7 @@ func (image *Image) CreateManifest() error {
for _, k := range keys {
manifest.TgtVars = append(manifest.TgtVars, k+"="+vars[k])
}
- file, err := os.Create(image.ManifestFile);
+ file, err := os.Create(image.ManifestFile)
if err != nil {
return NewNewtError(fmt.Sprintf("Cannot create manifest file %s: %s",
image.ManifestFile, err.Error()))
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/ba86d5cd/newt/cli/project.go
----------------------------------------------------------------------
diff --git a/newt/cli/project.go b/newt/cli/project.go
index 573ed2c..9213301 100644
--- a/newt/cli/project.go
+++ b/newt/cli/project.go
@@ -451,7 +451,7 @@ func (p *Project) Build() error {
}
// Mark package for this project as built
- projectPkg, err := pkgList.ResolvePkgName("project/"+p.Name)
+ projectPkg, err := pkgList.ResolvePkgName("project/" + p.Name)
if projectPkg != nil {
projectPkg.Built = true
}