**1**.商场里有n类产品,从高到低按价格排序,若价格相同则按生产日期排序,价格保留小数点后两位
```go
package main
import (
"fmt"
)
type Shop struct {
Price float32
Date string
}
func main() {
shops := []Shop{{1, "222"}, {7, "222"}, {3, "222"},
{4, "222"}, {5, "2018/1/21"}, {5, "2018/1/20"},{5, "2018/1/16"},{5, "2018/1/19"}}
num :=len(shops)
//先按价格用冒泡排序将商品从低到高排列好,若价格相同则判断日期,按由早到晚排序
for i:=0;i<num;i++ {
for j:=i+1;j<num;j++ {
if shops[i].Price >shops[j].Price{
shops[i],shops[j] =shops[j],shops[i]
}else if shops[i].Price ==shops[j].Price{
if shops[i].Date >shops[j].Date {
shops[i],shops[j] =shops[j],shops[i]
}
}
}
}
fmt.Println(shops)
}
```
**2**.将字符串左右镜面反转
```go
package main
import (
"fmt"
)
func main() {
str := "abcdef"
runes := []rune(str)
l := len(runes)
for i, j := 0, l; i < j; i, j = i+1, j-1 {
runes[i], runes[l-1-i] = runes[l-1-i], runes[i]
fmt.Println(string(runes))
}
}
```
**3**.说说对beego框架的理解,路由是怎样走的,beego设计思想是怎样的,
**4**.简述beego的思想,熟知bee的功能
**5**.简述go中的channel 、goroutine和interface,要求熟悉底层源码
**6**了解一些微服务
有疑问加站长微信联系(非本文作者))