type Art struct {
Title string `json:"title"`
Content string `json:"content"`
}
type ArtSlice struct {
ArtSlice []Art `json:"art_slice"`
ArtByte []byte `json:"-"`
}
...
sl:=ArtSlice{}
sl.ArtByte,err1 =json.Marshal(&sl)
...
f_tpl().ExecuteTemplate(w, "index", result)
log.Println("out:",result)
{
"catalog": [
{ "mainCategoryName": "01" }
{ "mainCategoryName": "02" }
{ "mainCategoryName": "03" }
{ "mainCategoryName": "04" }
{ "mainCategoryName": "05" }
{ "mainCategoryName": "06" }
{ "mainCategoryName": "07" }
{ "mainCategoryName": "08" }
{ "mainCategoryName": "09" }
{ "mainCategoryName": "10" }
{ "mainCategoryName": "11" }
{ "mainCategoryName": "12" }
{ "mainCategoryName": "13" }
{ "mainCategoryName": "14" }
]
}
$scope.sumF=function(a){
$scope.summTotal = 0;
var sum=0;
$scope.sumEnd=0;
for(var i = 0;i<a.length;i++){
$scope.sumEnd +=parseInt(a[i]);
console.log("i = ",i);
console.log("a[",i,"]=",a[i]);
}
$scope.summTotal = $scope.sumEnd;
console.log($scope.summTotal)
};
<div > {{ summTotal }}</div>
<div > {{ summTotal }}</div>
<div > {{ summTotal }}</div>
- docker-compose_postgres
- postgres_postgres
Следовательно было 2 сети с разными адресами.