我有在切片指针中返回数据的方法,现在我必须将其转换为切片数组。如何将切片指针转换为切片数组。
peerRoundState, err := s.nodeview.PeerRoundStates()
fmt.Println("This return value is slice pointer", peerRoundState)
if err != nil {
return nil, err
}
//PeerRoundStates this is type of slice.
return &ConsensusResponse{
RoundState: s.nodeview.RoundState().RoundStateSimple(),
PeerRoundStates: peerRound,
}, nil
我想将peerRoundState类型的切片指针转换为PeerRoundStates 切片数组。